Code Monkey home page Code Monkey logo

Comments (17)

ryanpcmcquen avatar ryanpcmcquen commented on June 14, 2024 1

😧

from clipboard.js.

notenociz avatar notenociz commented on June 14, 2024
Not supported :(

I would really like to see it in mobile because a lot of other options don't do it.

from clipboard.js.

chrismanderson avatar chrismanderson commented on June 14, 2024

For clarity, when I tested on both Safari and Chrome mobile browsers on iOS when, when I click a copy button on the demo site, I just see the 'Not Supported' popup. The browser focuses the input field, but the text is not selected. Even if we can't copy directly to clipboard on mobile, are there browser APIs available to at least automatically select the text waiting to be copied?

from clipboard.js.

notenociz avatar notenociz commented on June 14, 2024

@chrismanderson I did the exact same thing and got the exact same results.

from clipboard.js.

zenorocha avatar zenorocha commented on June 14, 2024

As described in the Browser Support section, execCommand is not supported on mobile yet. So for now, there's nothing we can do about it.

Regarding text selection on mobile, there's seems to be a workaround using setSelectionRange http://stackoverflow.com/questions/3272089/programmatically-selecting-text-in-an-input-field-on-ios-devices-mobile-safari

Pull requests are welcome.

from clipboard.js.

mdibaiee avatar mdibaiee commented on June 14, 2024

@zenorocha: I'm interested in fixing this bug, may you please clarify what exactly should be done?

Are we going to select the input text only if we're on mobile and copy is not supported?

from clipboard.js.

zenorocha avatar zenorocha commented on June 14, 2024

What should be done is simply selecting text on mobile devices.

from clipboard.js.

ryanpcmcquen avatar ryanpcmcquen commented on June 14, 2024

I do this (copies on desktop and Android, and selects on iOS): https://jsfiddle.net/ryanpcmcquen/dx5vvzc1/

from clipboard.js.

zenorocha avatar zenorocha commented on June 14, 2024

Hey @ryanpcmcquen, I tested on an iPhone & iPad but selection didn't work.

from clipboard.js.

ryanpcmcquen avatar ryanpcmcquen commented on June 14, 2024

@zenorocha are you on iOS 9? Try the full screen version (https://jsfiddle.net/ryanpcmcquen/dx5vvzc1/embedded/result/). Works here for me.

screen shot 2015-10-09 at 2 28 35 pm

from clipboard.js.

zenorocha avatar zenorocha commented on June 14, 2024

Confirmed that it does work on the iOS simulator but not on real devices.

from clipboard.js.

axelman24 avatar axelman24 commented on June 14, 2024

I just tested this on my iphone and my ipad and it worked for me! (Tested it in Safari)

from clipboard.js.

axelman24 avatar axelman24 commented on June 14, 2024

@zenorocha @ryanpcmcquen See comment above.

from clipboard.js.

ryanpcmcquen avatar ryanpcmcquen commented on June 14, 2024

Since it does seem to work on some iOS devices, I implemented a library for it:

https://github.com/ryanpcmcquen/simpleJsCopy

Not as robust as clipboard.js, but it may suit some people's needs. 👍

from clipboard.js.

zenorocha avatar zenorocha commented on June 14, 2024

Hey @ryanpcmcquen,

I see you discovered how make a selection on iOS devices. Could you make a PR?

from clipboard.js.

ryanpcmcquen avatar ryanpcmcquen commented on June 14, 2024

@zenorocha, I see you could not be bothered to star my repo while asking for code from it ... 😕

from clipboard.js.

zenorocha avatar zenorocha commented on June 14, 2024

Hey everyone, I just moved all selection logics from clipboard.js to a different repo called select c6dc01c.

Also moving this issue there zenorocha/select#1

from clipboard.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.