Skip to content

[BUG] Broken burger navbar with dropdown subnav #37

Description

@anthony-robin

Please search for duplicate or closed issues first. ✔️

Describe the issue

When using the burger nav with a subnav, dropdown items are hidden either in desktop and mobile views. It seems that role="navigation" applied to the nav is responsible of the bug. Without it dropdown is visible but the burger input form appears as well and in an incorrect position (see expected behavior section screenshot).

Current Behavior

Dropdown items are not visible on click (Account item)

Capture d’écran du 2025-01-14 16-34-00

Capture d’écran du 2025-01-14 15-49-30

Expected Behavior

Dropdown items should be visible on click.

Capture d’écran du 2025-01-14 16-31-43

Note that here, role="navigation" have been removed to the nav tag which breaks the burger form input.

Reproduction URL

Try this snippet:

<nav role="navigation" data-position="start">
  <ul role="list">
    <li> <strong> MyApp </strong> </li>
  </ul>

  <input type="checkbox" id="menu-btn2">
  <label for="menu-btn2" style="font-size: calc(var(--pico-font-size) * 1.3);" aria-label="Menu" aria-controls="nav-example2">
    &equiv;
  </label>

  <ul id="nav-example2" role="list">
    <li role="listitem"> <a href="#"> Accueil </a> </li>

    <li role="listitem">
      <details class="dropdown">
        <summary> Account </summary>

        <ul>
          <li> <a href="#"> Profile </a> </li>
          <li> <a href="#"> Settings </a> </li>
          <li> <a href="#"> Security </a> </li>
          <li> <a href="#"> Logout </a> </li>
        </ul>
      </details>
    </li>
  </ul>
</nav>

Environment

  • pico.min.css 2.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions