-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clipboard.js (naturally) does not work with stopPropagation() on parents #91
Comments
Yay :) Thanks! |
I'm having a similar problem wherein a Clipboard listener in a Bootstrap modal returns success, and shows the correct text and so on in the console (using your example code in the Readme)... but nothing is actually copied to the clipboard. I'm using v1.5.5 on Firefox with Bootstrap 3. It works as expected when the clicked element is not in a modal. |
Hey guys! Are you actually planning to fix this issue and when it'll be ready? I am kind of waiting for it. Thanks |
This issue is still present in the latest version, how can I fix this? |
Have you guys tried passing a node or nodelist? https://github.com/zenorocha/clipboard.js/blob/master/demo/constructor-node.html |
@graphographer see #155 |
So I tried to get to work clipboard.js with a button inside a modal.
Problem is, there's something like
$( "body" ).one( function () { modal.close(); } );
. Not exactly that code, but take it like that to keep this simple.Of course the
click
event registered on the modal stops the event propagation to not get closed which means clipboard.js by design won't work inside that modal.So my question: Is there a way around it?
Could there be a config option provided by the constructor which creates an additional "parent" for event delegation?
Sounds weird, I know, but that's the only kind-of-reasonable solution my mind came up with.
The text was updated successfully, but these errors were encountered: