flet icon indicating copy to clipboard operation
flet copied to clipboard

Enable/disable right-click events on web

Open mghiggins opened this issue 1 year ago • 3 comments

Discussed in https://github.com/flet-dev/flet/discussions/2719

Originally posted by mghiggins February 22, 2024

Question

I've got a flet app that includes controls that handle right-click events. It all works fine when I run it as a desktop app; but when I run it as a web app in the browser, right-clicking pops up the usual browser right-click popup menu, and the app's right-click event handler is never called. How do I make it ignore the browser's right-click handler?

Code sample

No response

Error message

No response

------------------------------------------------------

  • [X] I have searched for answers to my question both in the issues and in previous discussions.

mghiggins avatar Mar 16 '24 15:03 mghiggins

Dev Link: https://api.flutter.dev/flutter/services/BrowserContextMenu-class.html#static-methods

ndonkoHenri avatar Mar 19 '24 09:03 ndonkoHenri

Dev Link: https://api.flutter.dev/flutter/services/BrowserContextMenu-class.html#static-methods

Ah ha! That looks useful - but is that exposed in flet? I searched the flet docs and didn't see any mention of BrowserContextMenu, and flet.BrowserContextMenu doesn't exist.

mghiggins avatar Mar 20 '24 12:03 mghiggins

The link is for the dev going to work on implementing this.

ndonkoHenri avatar Mar 20 '24 15:03 ndonkoHenri