phonegap

 

iPhone: Prevent copy paste

Page history last edited by Shazron Abdullah 2 mos ago
Problem:
I am doing Javascript animation and I don't want Copy and Paste to  
keep popping up if user happens to touch the object longer. 
 
Solution:
You can set this in CSS:
 
* {
   -webkit-user-select: none;  /* prevent copy paste for all elements */
 
Best practice according to Apple is to not disable this for all elements, but for selected elements. Users will expect to have copy and paste for text elements, for example.  So enable it for certain elements:
 
.my_text_element {
   -webkit-user-select: text;  /* enable copy paste for elements with this class */

Comments (0)

You don't have permission to comment on this page.