konstantinmuenster / lexical-floating-menu

Designed for @lexical/react. Headless & fully-customizable.
https://lexical-floating-menu.vercel.app
MIT License
33 stars 1 forks source link

Suggestions for mobile? #7

Closed benjick closed 3 months ago

benjick commented 3 months ago

Hey!

Thanks for making this plugin, it works great. I just have one question, how do I solve this issue on mobile where the native contextmenu is shown above the floating menu?

image This is on selection

image Here is when I have moved the native contextmenu, but I'm not sure my average visitor will be aware of this

I tried setting onContextMenu={(e) => e.preventDefault()} but that made me not be able to select text at all

Any suggestions?

Cheers Max

konstantinmuenster commented 3 months ago

Hey @benjick!

Great question. As far as I know there isn't any reliable way of doing this across browsers. I usually went the same route as you did: repositioning both menus so that one opened above and the other one below.

Hope that helps (although it's probably not the answer you wanted to hear 😉).

benjick commented 3 months ago

Thanks! I figured so, I couldn't find anything of my own but it was worth a shot!

Btw, can the popup be triggered when editable: false?

konstantinmuenster commented 3 months ago

Btw, can the popup be triggered when editable: false?

Yep, that should still work despite the flag.