Problem
DropdownMenuSimple offers no way to style the submenu content (DropdownMenuSubContent).
- The
className prop on DropdownMenuSimple is forwarded only to the top-level DropdownMenuContent.
item.className on a submenu item is forwarded only to the DropdownMenuSubTrigger — the sub-content is rendered bare: <DropdownMenuSubContent>{children}</DropdownMenuSubContent>.
- The sub-content is portaled to
document.body as a sibling of the main content, so neither the content's class nor CSS variables set on it cascade to the submenu.
Impact
- Sub-content z-index is locked to its default (
var(--dropdown-menu-sub-content-z-index, 50)).
- Any consumer rendering a
DropdownMenuSimple with submenus near a higher-stacked element (e.g. FloatingPanel at z-index 999) gets the submenu opening behind it, while the parent menu (stylable via className) renders fine.
- Hit in SigNoz trace details: "Colour by" submenu opened behind the Analytics floating panel; had to drop the preset and recompose from primitives just to pass a
className to DropdownMenuSubContent.
Proposed fix
Either (or both):
- Forward a
subMenuClassName (per-item or top-level prop) to DropdownMenuSubContent in the simple preset.
- Support
item.subMenuClassName on SubMenuItem so each submenu's content can be styled independently of its trigger.
Repro
- Render
DropdownMenuSimple with a submenu item next to any element with z-index > 50.
- Pass
className with a higher z-index — parent menu stacks correctly, submenu still opens behind the element.
Problem Link: SigNoz/signoz#11556 (review)
Problem
DropdownMenuSimpleoffers no way to style the submenu content (DropdownMenuSubContent).classNameprop onDropdownMenuSimpleis forwarded only to the top-levelDropdownMenuContent.item.classNameon a submenu item is forwarded only to theDropdownMenuSubTrigger— the sub-content is rendered bare:<DropdownMenuSubContent>{children}</DropdownMenuSubContent>.document.bodyas a sibling of the main content, so neither the content's class nor CSS variables set on it cascade to the submenu.Impact
var(--dropdown-menu-sub-content-z-index, 50)).DropdownMenuSimplewith submenus near a higher-stacked element (e.g.FloatingPanelat z-index 999) gets the submenu opening behind it, while the parent menu (stylable viaclassName) renders fine.classNametoDropdownMenuSubContent.Proposed fix
Either (or both):
subMenuClassName(per-item or top-level prop) toDropdownMenuSubContentin the simple preset.item.subMenuClassNameonSubMenuItemso each submenu's content can be styled independently of its trigger.Repro
DropdownMenuSimplewith a submenu item next to any element withz-index > 50.classNamewith a higher z-index — parent menu stacks correctly, submenu still opens behind the element.Problem Link: SigNoz/signoz#11556 (review)