Skip to content

[context menu] Sub root part #2038

@atomiks

Description

@atomiks

Currently, it's not possible to disambiguate a submenu and a new root menu that's nested in the React tree while reusing the ContextMenu namespace.

This is more obvious/clear with a ContextMenu than a regular Menu, because they can easily be nested.

As a result of a missing .Sub or .Subroot part, the current API requires you use Menu to create a submenu, rather than additional parts directly on ContextMenu:

<ContextMenu.Root>
  <ContextMenu.Trigger>
    <ContextMenu.Root> {/* this is a new root, not a submenu *}
      ...
    </ContextMenu.Root>
  </ContextMenu.Trigger>
</ContextMenu.Root>

While it may only apply to ContextMenu in most cases, for consistency, it may be better for all Menu components to work the same

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: context menuChanges related to the context menu component.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

    Projects

    Status

    Recently completed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions