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
Not degrading gracefully on iOS 9.x - select() no longer works #206
Comments
Interesting, if you have a solution please send a pull request to https://github.com/zenorocha/select. |
Unfortunately the problem is not only Safari, this script simply doesn't work on all the browsers running on IOS9.2.1. |
It doesn't work in all the iOS browsers because in iOS every browser runs a Safari webview. |
Tested the clipboardjs.com page on both iPad and iPhone (iOS v9.3.1) and select is working. If you're still facing this error, please share a JSFiddle so we can reproduce it. |
This site is using clipboardjs: http://demo.chevereto.com/ |
We're talking about the selection, not the support. As showed in the documentation and the website, clipboard.js doesn't work on Safari. |
Also seeing this issue on an iOS 9.3.2 on iPad, not functioning or degrading on Chrome or Safari. See this JSFiddle: https://jsfiddle.net/amhwjm69/ EDIT: Above fiddle is trying to copy text from a div. Seem to function correctly with input elements. |
I realize Safari and Mobile Safari aren't fully supported, but I've noticed clipboard.js no longer degrades gracefully on Mobile Safari.
It seems that Apple has neutered the
select()
function as of iOS 9.x, which clipboard.js uses. I've read that a more browser-inclusive option is to usesetSelectionRange()
, eg:targetElement.setSelectionRange(0, targetElement.value.length)
See the note here under the section Programmatically selecting a portion of a field's value:
http://www.javascriptkit.com/javatutors/copytoclipboard.shtml
I'll experiment with this and post an update here if I can get it working.
The text was updated successfully, but these errors were encountered: