zenorocha / clipboard.js

:scissors: Modern copy to clipboard. No Flash. Just 3kb gzipped :clipboard:
https://clipboardjs.com
MIT License
33.98k stars 3.98k forks source link

Html attribute conflict #849

Closed kruggs closed 1 year ago

kruggs commented 1 year ago

Hi,

First, thanks for you nice light tool :)

It's not really a bug, but it's a bit "annoying" and could lead to error at some point.

The component Symfony WebProfilerBundle (the debug tool bar) are using the same html attribute as Clipboardjs. (code here) ClipboardJs is working but there is do js code which is listening the same html attribute.

I was thinking, maybe you could change data-clipboard-text to data-clipboardjs-text. Since it's BC, you can maybe let the user set the data name attribute he wants in the config to overwrite the default ?

I'm using : clipboard 2.0.11

To Reproduce

  1. Create basic symfony project
  2. Use and enable WebProfilerBundle
  3. Add on a element `data-clipboard-text="hello"

Thanks

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.