-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Since I found not no docs and no help on forums, etc. We should clarify that here:
How to disable the context menu of the browser when right click or long press (browser, on touch press release)?
In JavaScript it's:
document.body.addEventListener('contextmenu', (evemt) => {
event.preventDefault();
});But how to do this in Flutter (2.x, Web)?
If this feature is missing: Here's the feature request: Implement the possibility to disable the context menu. No workaround like blocking right click, please. Because it also appears on mobile long press.
Ok, I could disable the context menu when deploy the flutter app. Because it's just an index.html with the flutter JS / Canvas etc. But how to access the html during debugging / coding?
E.g. is there a way to inject JavaScript? But note: It should also work (ignored) as native mobile app.
Btw. Flutter should disable the browser context menu by default. Because there is nothing to select. It's jsut the canvas.