首页 > 解决方案 > How can I prevent a browser from generating ContextMenu event for a long touch

问题描述

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?

标签: javascriptreactjstypescriptchromium

解决方案


推荐阅读