Skip to content
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

Closed
loilo opened this issue Oct 15, 2015 · 7 comments
Closed
Labels

Comments

@loilo
Copy link

loilo commented Oct 15, 2015

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.

@zenorocha
Copy link
Owner

Hey @loilo, as soon as I merge #75 you might be able to fix that ;)

@loilo
Copy link
Author

loilo commented Oct 16, 2015

Yay :) Thanks!

@graphographer
Copy link

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.

@kuba108
Copy link

kuba108 commented Jan 11, 2016

Hey guys! Are you actually planning to fix this issue and when it'll be ready? I am kind of waiting for it. Thanks

@Sirence
Copy link

Sirence commented Apr 12, 2016

This issue is still present in the latest version, how can I fix this?

@zenorocha
Copy link
Owner

@graphographer see #155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants