webui-dev / webui

Use any web browser or WebView as GUI, with your preferred language in the backend and modern web technologies in the frontend, all in a lightweight portable library.
https://webui.me
MIT License
2.95k stars 172 forks source link

Context menu control #340

Open mitchcapper opened 6 months ago

mitchcapper commented 6 months ago

This adds setContextMenuEnabled to the webui object for users to be able to turn it on and off. I think the best reason to allow a user to use a 3rd party context menu like: https://github.com/fkhadra/react-contexify

A few other minor things: ) Used passive event binding for situations where we don't modify the event object ) Moved the context menu bind off body to the document itself. Otherwise you can right click on the lower part of the window with shorter pages. *) To avoid duplicating code I moved the load handler inside the main class. There may be some specific reason it wasn't, but I didn't see what it was.

AlbertShown commented 6 months ago

Thank you 👍 Needs to be tested first