August 20, 2009

Turning off copy-paste in a UIWebView

Posted in iPhone development tagged , , , , at 6:02 am by tetontech

This defect is now fixed.  To turn off copy-paste for both mobile Safari and the UIWebView put webkit-user-select:none; in the CSS class of the body.  To turn it on use webkit-user-select:none;

Or if you are using QuickConnect you can call copyPaste(false); to turn it off and copyPaste(true)to turn it on.

It looks like the latest version of iPhone OS 3.0 no longer allows you to use webkit-user-select:none; to turn off copy-paste.  This is unfortunate.  Hopefully this is only a defect.  Granted, I have only tried this on the Simulator at this point, but it used to work there.

I have submitted this as a bug to apple (Bug ID# 7164604).

2 Comments »

  1. Egor Egorov said,

    And what did they replied? Unfortunately, I cannot see the bugreport, seems like radar is not allowed to see other people’s bugreports.

    • tetontech said,

      No response yet.


Leave a comment