Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove text selection from PhoneGap iOS app

Tags:

ios

cordova

I am trying to find a way to be able to restrict text selection within the entire PhoneGap application. Anyone know a way to do this?

like image 634
Alex Farnsworth Avatar asked Dec 12 '22 17:12

Alex Farnsworth


1 Answers

this will work for you:-

<style type="text/css">
   *:not(input):not(textarea) {
   -webkit-user-select: none; /* disable selection/Copy of UIWebView */
   -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
  }     
</style>

Using java script:-

 document.documentElement.style.webkitTouchCallout = "none";
 document.documentElement.style.webkitUserSelect = "none";
like image 114
Suhas Gosavi Avatar answered Jan 16 '23 01:01

Suhas Gosavi