Disabling ‘hold to copy’ on Mobile Safari

If you want to disable the ‘Cut / Copy / Paste’ invoked by holding down on an element in Safari on the iPhone or iPad use the css:

-webkit-user-select: none;

However, as stressed by Apple, this should only be disabled on a per element basis, and never applied to the whole document.

Apple’s Technical Note TN2262: Preparing Your Web Content for iPad covers this along with using web standards instead of plugins (something that really interests me at the moment).

14 thoughts on “Disabling ‘hold to copy’ on Mobile Safari

  1. The link you’re using looks to be broken. Do you know why this shouldn’t be applied to the entire document? If you’re writing a game using PhoneGap, I think that’s what you’d want.

    • Thanks, I’ve updated the link. You’re only meant to apply it to interface elements like menus. But you’re right, for a game you’d likely want it applied to everything.

  2. I tried to implement this for a text box, and it disallowed you from even typing in the text box. Still searching for a way to programmatically disable Copy/Paste in a text box on a tablet.

    • In a mobile interface restricting cut / copy / paste on user interface elements isn’t an attempt to prevent content being copied, it’s a user experience decision.

  3. I have a button that acts like a momentary switch. Without any additional code it works fine in Chrome on my Ipad,
    works fine on Safari on my IMAC, but it does not work in Safari on my Iphone.
    If I press the button for longer than one second or so, it says: Copy | Define
    So I need to disable the select & copy.
    I have added the code below in my .html file. In the header.

    {
    -webkit-user-select: none; /* Disable selection/Copy of UIWebView */
    }

    However, the problem on my Iphone remains.
    How can I solve this?

    Thanks,

    Timo

  4. We use several iPads in our business and one of the issues we keep coming across is that some employees are using the copy & paste function for their note entries so that they don’t have to type it in each time. We’ve tried telling them not to copy and paste, that each entry should be unique for that time of entry. I have read through the entire thread above and can’t figure out what I need to do to get this to work. They use a special website that we had developed for this purpose. Every morning the notes that were entered are then emailed to each client. We have about a 3 hour window when we receive the report to when our clients receive the report. This gives us a few hours to review all entries and make the necessary corrections. If I could figure out how to disable the Copy/Paste ability altogether then I wouldn’t need to worry about anything but spelling errors.

Leave a Reply

Your email address will not be published.

Comment moderation is enabled. Your comment may take some time to appear.