Phonegap ( cordova ) and iOS longtap

This is perhaps the most significant effect of using a webview for iOS development. When working with Phonegap(cordova) which uses WebView, the user gets a longtap event as it use to on a web browser. All sort of long tap menus will come up in an application using Phonegap (ex : select, copy etc).
To suppress these unwanted menus on a native application, which uses Phonegap(Cordova), there are a number of options found throughout the internet, but the one which worked for me is a style declaration as below.

/* Disabling the default iOS bevaviour of copy-paste on long tap */
*: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 */

}

Happy coding :)

4 thoughts on “Phonegap ( cordova ) and iOS longtap

Comments are closed.