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

Firefox - Dynamic content jQuery Dialog - the text is not copied to clipboard #187

Closed
loter opened this issue Feb 16, 2016 · 9 comments
Closed

Comments

@loter
Copy link

loter commented Feb 16, 2016

Hi,

I have it in jquery dialog - when I press copy, the console displays
Action: copy
Text: "MyText"
Trigger:

but the result ("MyText") doesn't go to clipboard for some reason. Any hints?

@loter
Copy link
Author

loter commented Feb 16, 2016

Sorry, tried to replicate on jsFiddle, looks like something is interfering, so not a clipboard.js issue.
https://jsfiddle.net/0rab1zxL/12/

@loter loter closed this as completed Feb 16, 2016
@zenorocha
Copy link
Owner

Cool, thanks for coming back and letting me know ;)

@kafeltz
Copy link

kafeltz commented Feb 16, 2016

@loter I see something strange in fiddler example, with textarea (or any input) you get the value by method $().val() and not by $().text(). The latter is used with dom elements like a, b, i, span, p but not inputs.

@loter
Copy link
Author

loter commented Feb 17, 2016

Did some more investigation since we are using this library (thank you, we like it!), but this is some kind of bug, maybe you can figure out and fix it, the test cases are:

  1. On firefox browser only, using JQuery 1.9 and Jquery UI - COPY WORKS
    https://jsfiddle.net/0rab1zxL/31/
  2. Same code, On firefox browser only, using JQuery 2.1 and Jquery UI - COPY DOESN'T WORK
    https://jsfiddle.net/0rab1zxL/32/

kafeltz, you're right, but it doesn't fix the issue and still works in the same way.

@loter loter reopened this Feb 17, 2016
@loter loter changed the title When it's in jquery dialog - the text is not copied to clipboard Firefox - Dynamic content jQuery Dialog - the text is not copied to clipboard Feb 17, 2016
@kafeltz
Copy link

kafeltz commented Feb 17, 2016

Indeed in firefox has a problem with jQuery 2.1.x
It seems to be related to jQuery UI with some preventDefault somewhere.

@zenorocha
Copy link
Owner

Still no idea why this is happening. If you find a solution, feel free to send a PR.

Added to Known Limitations wiki page

@ghost
Copy link

ghost commented May 7, 2016

@zenorocha Is there any reason why you removed the notice on the "Known Limitations" wiki page? I have the same issue with newest version of jquery, jquery ui and clipboard.js, so I'm really curious if there is a fix, or at least a workaround, for it.

https://github.com/zenorocha/clipboard.js/wiki/Known-Limitations/_compare/e388b93b954b4db12e527477e2e8276e4c39a4b2...4cdc6501dfc6d746b5ee5d8fef48bc4ca819a4f0

@zenorocha
Copy link
Owner

Hey @CharlotteDunois, we found the solution for Bootstrap's Modal so I moved that part to "Known Issues".

For jQueryUI's Dialog, I found a very similar solution. Try adding this line to your code:

$.ui.dialog.prototype._focusTabbable = $.noop;

More info at: https://github.com/zenorocha/clipboard.js/wiki/Known-Issues

@zenorocha
Copy link
Owner

Check the new container option introduced by #368 on v1.7.0

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

No branches or pull requests

3 participants