Skip to content

DropdownMenuSimple: submenu content (DropdownMenuSubContent) is not stylable — locked behind higher-stacked elements #275

@aks07

Description

@aks07

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

  1. Render DropdownMenuSimple with a submenu item next to any element with z-index > 50.
  2. Pass className with a higher z-index — parent menu stacks correctly, submenu still opens behind the element.

Problem Link: SigNoz/signoz#11556 (review)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions