Skip to content

Why is <NavigationMenu.List> wrapped in a div with relative positioning? #1873

@adatti

Description

@adatti

I just noticed that NavigationMenu.List isn't rendered simply as a ul but as a div style="position:relative" and a ul inside it. The div seems out of reach, because the attributes I set on the NavigationMenu.List only apply to the ul. This can be seen by inspecting the element in this sandbox or on the radix navigation menu demo page.

image

Is there a reason for this? I only just noticed this and it kind of breaks my heart layout. I can get the div to be ignored by my CSS by adding display: contents to it, but I have to select it awkwardly with .nav > *:nth-child(2) (because the div happens to be the second child of the nav).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions