-
Hello, I'm making a simple project where I'm planning on having left and right mouse clicks shoot different bullets, I am wondering how to prevent the right click popup menu from showing in the browser, what I've tried so far doesn't work:
I apologize in advance if this is somewhere obvious in the documentation, I haven't been able to find it so I figured I'd ask. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @dpayne5, You can override the browser handler https://codesandbox.io/s/context-menu-9rgk0?file=/src/index.ts Quick example:
|
Beta Was this translation helpful? Give feedback.
Hi @dpayne5,
You can override the browser handler
document.oncontextmenu
and returnfalse
out of it to prevent the default browser behaviorhttps://codesandbox.io/s/context-menu-9rgk0?file=/src/index.ts
Quick example: