-
Notifications
You must be signed in to change notification settings - Fork 643
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
Menu Separator #7790
Comments
An idea that @NigelBreslaw brought up was instead of a Menu {
MenuItemGroup {
MenuItem { ... }
MenuItem { ... }
}
MenuItem { ... }
} Separators are inserted automatically at the edges of groups, unless they are at the beginning or the end of the menu. Between two adjacent groups, only one separator gets inserted. This approach also has the advantage that it plays well with dynamic menus and avoids having to have logic that eliminates trailing or leading separators. |
Could you elaborate?
That's not very elaborate logic. The logic to understand MenuItemGroup and place separator accordingly seems more elaborate. |
I looked into this a bit more and although React Native Reusables(RnR) abstracts the separator away, the libraries that inspired it like Radix and Shadcn have a separator. Which seems to make sense as the 2 later libraries should allow you to make anything, while RnR is bit more restrictive to do more things automatically for you. So probably the lower level menu should have a separator? RnR does make sense though because MenuGroups are not the only group it offers. You don't have to explicitly say 'this is a submenu'. You add a MenuSub group. Same for radio menus which are just menu items inside a MenubarRadioGroup. |
We should add a
MenuSeparator {}
(or justSeparator{}
?) element inMenu
that acts as a menu separatorSeparator at the beginning or at the end should be ignored. Multiple separator in a row should result in only one separator.
The text was updated successfully, but these errors were encountered: