I want to restrict default context menu on long press in android/ios devices and show my custom menu. Please note that it's a normal web page opening in a mobile browser.
Asked
Active
Viewed 366 times
1 Answers
0
It's the same as disabling right click - add this listener:
document.addEventListener('contextmenu', event => event.preventDefault());
Tested on Firefox for Android

zelitomas
- 113
- 8
-
@Sairam Rugada Did it help? – zelitomas Aug 04 '17 at 20:36
-
It worked fine. Sorry for the late response as I missed it. – Sairam Rugada May 15 '19 at 11:49