In a web app, I need to disable the default callout that mobile browsers shows when touching and holding ("long tap") on a touch target, such as an <img>
or a link.
I am already using -webkit-touch-callout: none
for iPhone and iPad. I tried -ms-touch-action:none
and touch-action:none
for IE, but this doesn't seem to work (tested on IE11, Windows Phone 8).
This post from the W3 mailing list suggests adding a listener for the "contextmenu" event in Javascript and calling e.preventDefault()
. This does not seem to work either.
Any suggestions?