2

Browsers support touch events and might generate mouse events. Also, for a long touch the browser generates a ContextMenu event. However, in my industrial environment, I want all touch events to be handled like a click event. Is there a global setting to prevent the browser to generate context menu events? Or can I at least set the time when the browser will generate such an event?

My only solution I came up with so far is the subscribe to click and context menu events and call the same handler. However I would rather avoid this for every button in my application...

Any ideas?

1 Answers1

0

There are several answers at Disabling the context menu on long taps on Android

But I think the most voted answer over there is not a good one. Try and see if this work for you,

window.ontouchstart = function(event) {
     event.preventDefault();
     event.stopPropagation();
     return false;
};
HolyResistance
  • 594
  • 1
  • 8
  • 26