Open misiekhardcore opened 7 months ago
@misiekhardcore Hey, thanks for reporting this. The stackblitz link you posted isn't working for me.
hey @tay1orjones I think it was set to private. Please let me know if it works now
Hey @misiekhardcore That is intentional and not a bug. Check this description for more information: https://github.com/carbon-design-system/carbon/blob/00dc60f210edeaa83bebbb96dbbda50285941cf5/packages/react/src/components/Menu/Menu.tsx#L463-L470
Hey @guidari I've seen that description but it does not really explain why in MenuButton
this is set to basic (the description says it will be determined automatically but in this case it is not)
Hey Michał, the behavior is working as expected. Both MenuButtons and ComboButtons are not intended to be used for complex scenarios like nested or selectable items. This is reserved for OverflowMenu (only with enable-v12-overflowmenu
flag) and the core Menu (used by useContextMenu
).
@thyhmdo Did we ever clarify that to the design guidance? I can't find it right now.
@janhassel I see, thanks for the clarification. For me the OverflowMenu
is not a solution because I need it to be primary and with text. Something like this
I would be also interested with the design guide explanation for disabling nested menu for the MenuButton
@misiekhardcore We didn't clarify this in our guidance, but we will add this update for nesting options in MenuButton after a discussion with other product teams. Meanwhile, another solution is as Jan's suggestion here without violating the code. It can use the divider to separate categories.
@thyhmdo hey, thanks for the suggestion. Unfortunately, I think this won't work in our case because if we merge all the things from all the sub-menus into just one list divided by separators we are encountering two issues:
thanks @misiekhardcore We will do another research and clarify our guidance on this issue
FWIW It sounds like this used to work in @carbon/react@1.48.1
I'm also not sure this is a bug, we might want to classify this moreso as an enhancement. If it does work in an older version, we never wrote tests for it or included it in the storybook as an example.
Package
@carbon/react
Browser
Chrome
Package version
v1.51.1
React version
17.0.2
Description
When using the
MenuButton
with nestedMenuItem
s we get the warning in the console: I can see that inMenuButton
implementation the innerMenu
s propmode
is set tobasic
, so this is the reason I assume, but what is it for a purpose or is it a bug?Reproduction/example
https://stackblitz.com/edit/github-rztleo?file=src%2FApp.jsx
Steps to reproduce
Suggested Severity
None
Application/PAL
No response
Code of Conduct