-
Notifications
You must be signed in to change notification settings - Fork 1.9k
FloatingUI Context Menu #7509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
FloatingUI Context Menu #7509
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@etrepum This is ready to skim over. Playground is produced fine. I'll fix the types tomorrow. Most of the code is canonical as per the FloatingUI example for a context menu. I had to make some creative choices for the conditional rendering and the editor.read for the underlying node, since the examples use pre-defined children to the main component and wanted to keep the main render components exposed to be overridden. Welcoming interface comments. |
The things I'd do differently in the interface:
As far as the implementation goes, just some things I'd simplify:
|
Great! Thanks! I'll fix those up. The reason I split the conditional and default options was, that conditional options was intended as on object offering multiple items per 1 rule eval, vs 1 rule for 1 option, but forgot to do it. One last question I have is, should I add a new plugin in the react package and export ContextMenu2 and make this opt-in and make the breaking change later when we have all menus migrated vs now. |
Maybe call it NodeContextMenu and deprecate the other one? |
A complete rewrite of the ContextMenu using FloatingUI without using the current LexicalMenu component. This makes the migration of the other typeahead menus to FloatingUI easier.
This is a breaking change. The migration effort should be minimal as I kept the playground top-level interface as close as possible.
This PR introduces the following improvements: