-
Notifications
You must be signed in to change notification settings - Fork 40
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
Copy not working when triggered inside a Vuetify dialog #18
Comments
This seems to be a general problem with this method of copying. My hunch is that when appending an element to the The solution there, which I believe could also be added to this library, is to allow providing an element as an option so you can append the copiable element somewhere within the dialog which will allow it to copy as expected. |
I was struggling with this issue a few hours until I found this thread: vuetifyjs/vuetify#6892 (comment) What fixed it for me in the end was this method as suggested in the thread above by the user Pazza:
I just turned it into a mixin and removed the plugin from my codebase. One less dependancy so its even better. I tested it only in Chrome and Firefox and there it works. If you need to support older browsers it might make sense to test it there before implementation. |
You can also use the Clipboard API since methods: {
clipboard (str) {
navigator.clipboard.writeText(str).then(() => {
// success
},() => {
// error
});
},
},
|
I've played around with this a while now and noticed that this composition works:
However, when I implement a Vuetify dialog in my template, it no longer works, as in the text www.fakeurl.com does not get copied upon button press. No errors in console either.
Any advice on why the copy function won't work when nested in elements inside Vuetify framework elements?
Thanks!
The text was updated successfully, but these errors were encountered: