Skip to content

Instantly share code, notes, and snippets.

@netpoetica
Last active April 10, 2025 19:00
Show Gist options
  • Select an option

  • Save netpoetica/a1234ae1d4d2988f03ef to your computer and use it in GitHub Desktop.

Select an option

Save netpoetica/a1234ae1d4d2988f03ef to your computer and use it in GitHub Desktop.
iOS Disable User Select but Allow Input (Snippet)
* {
/* Disable selection/Copy of UIWebView */
-webkit-touch-callout: none;
-webkit-user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
input,textarea {
/* Exception for input areas */
-webkit-touch-callout: default !important;
-webkit-user-select: text !important;
}
@larssn
Copy link

larssn commented Aug 4, 2017

Also works in WKWebView. Thanks for the snippet.

@yuvaraj119
Copy link

How to use or apply to WKWebView?

@larssn
Copy link

larssn commented Apr 10, 2025

Don't remember at this point unfortunately. And these days I would never recommend working with WKWebView - so many better alternatives to hybrid apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment