I want to be able to use a right-click in a single page (react) app. Every time I right click, the browser handles it instead of letting my app handle it. This seems to happen with Chrome and Safari. Is there a way to tell either browser to pass the right-click to the web app?
Asked
Active
Viewed 191 times
-4
-
I believe the cited question doesn't answer the question because it addresses how to enable and deal with mouse clicks in a web app. My concern is that the right-click never gets to my web app and is caught by the browser itself. I expect there is a simple way to tell Chrome or Safari to not do this and let the right-click get to the app itself. – Steve Webber Jan 03 '20 at 13:23
-
Were you looking for `event.preventDefault()`, which prevents the default context menu from opening – Samathingamajig Mar 16 '21 at 04:30
1 Answers
1
onContextMenu
Please refer to the official documentation to get a complete list of mouse events.

hotpink
- 2,882
- 1
- 12
- 15
-
I do not want the browser or OS itself to intercept the event and not pass it on. – Steve Webber Jan 01 '20 at 12:50
-
Why was this question closed? It was not answered by the question cited. Whoever closed it did not clearly read my question. – Steve Webber Jan 02 '20 at 18:42
-
4The question is probably rather brief @SteveWebber. Can you explain - maybe in the comments under the question itself - why the proposed duplicate is not satisfactory. "Not answered by it" is in itself a rather brief explanation too. Three experienced users here took the opposite view - can you explain how they are mistaken? – halfer Jan 02 '20 at 19:26