question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:4
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
zenorochacommented, Apr 4, 2016

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.

0reactions
rdunkcommented, 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.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found