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

Not degrading gracefully on iOS 9.x - select() no longer works #206

Closed
dumb opened this issue Mar 10, 2016 · 8 comments
Closed

Not degrading gracefully on iOS 9.x - select() no longer works #206

dumb opened this issue Mar 10, 2016 · 8 comments

Comments

@dumb
Copy link

dumb commented Mar 10, 2016

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 use setSelectionRange(), 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.

@zenorocha
Copy link
Owner

Interesting, if you have a solution please send a pull request to https://github.com/zenorocha/select.

@tiosecurity
Copy link

Unfortunately the problem is not only Safari, this script simply doesn't work on all the browsers running on IOS9.2.1.

@chevereto
Copy link

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.

@zenorocha
Copy link
Owner

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.

@tiosecurity
Copy link

tiosecurity commented May 1, 2016

This site is using clipboardjs: http://demo.chevereto.com/
would be great if you take a look and test, because it doesn't copy the codes after upload the files. that's the problem. (Already tried with 3 devices on 9.3.1, doesn't work) Thanks Sir.

@tiosecurity
Copy link

tiosecurity commented May 2, 2016

I've also checked even in your own site with the same results on my ios devices with 9.3.1
issue

@zenorocha
Copy link
Owner

We're talking about the selection, not the support. As showed in the documentation and the website, clipboard.js doesn't work on Safari.

@rdunk
Copy link

rdunk commented Sep 5, 2016

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.

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

4 participants