-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(menu): support menu modes #14793
Conversation
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks for submitting this @janhassel! Sorry for the delay in reviewing. The biggest concern I have with throwing an error is that if this were to happen in production, React would completely unmount everything. Devs should be using Instead of throwing an error, I think it might make more sense to pop a carbon/packages/react/src/internal/warning.js Lines 10 to 27 in 36685a0
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apologies for the delay on this @janhassel I was OOO for a few days. Looks good 😎
@andreancardona It looks like the auto-merge was cancelled. Could you take a look? |
18767e5
* feat(menu): support menu mdoes * refactor(menu): use warning instead of error for valid use --------- Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com>
Closes #14770
Adds the menu modes "basic" and "full" described in #14770 to support icons in MenuButton and ComboButton while restricting the use of nested and selectable items.
Opening as draft PR as the error throwing should be added to the unit tests, but first I wanted to clarify if throwing errors in this case is aligned to the Carbon ecosystem. A potential issue I see with this is that the errors are defined in
MenuItem
and therefore only throw once the MenuButton or ComboButton is opened.Changelog
New
props.mode
toMenu
and its contextTesting / Reviewing
MenuItemSelectable
orMenuItemRadioGroup
as children to MenuButton and ComboButton)