Not degrading gracefully on iOS 9.x - select() no longer works
See original GitHub issueI 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.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:8 (3 by maintainers)
Top Results From Across the Web
iOS select onchange not firing - javascript - Stack Overflow
iOS tends to not fire change events when you change the value of their inputs. I've documented this in more depth at the...
Read more >Handling OS Signals To Guarantee Graceful Degradation In Go
Failing to heed to this simple advise can create a huge mess that's not only difficult to track, but also very difficult to...
Read more >Wallet Developer Guide: Pass Design and Creation
Passes Are Identified by Pass Type Identifier and Serial Number ... are all valid on iOS 9 and later; therefore, they do not...
Read more >Cross Browser Compatibility Issues With Form Input Types
In unsupported browsers, < input type”date” >(or time,week,month, or datetime-local) degrades gracefully to a simple text box < input type="text ...
Read more >Understand IOS XR Software Maintenance Updates (SMUs)
This document describes Software Maintenance Updates (SMUs) for routers that run Cisco IOS® XR software.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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.
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.