BUG-048
ID:BUG-048Status:reported

The menubar nav behaviour skips every group, so menubars get no ARIA or keyboard support

Found by the behaviour audit for SPEC-196 D6. Confirmed by reading the code; not yet reproduced in a browser.

The menubar behaviour finds each group's list as a direct child of the group:

Severity:majorMilestone:v0.50.0Source:SPEC-196
claude/composition-usage-rune-pages-c87ar6 View source
Branches 3
History 5
  1. aea7072
    Content editedby bjornolofandersson
  2. 03137f0
    by bjornolofandersson
  3. cdb2bfc
    Content editedby bjornolofandersson
  4. 26e923a
    Content editedby bjornolofandersson
  5. 563be78
    Created (confirmed)by bjornolofandersson

Steps to Reproduce

  1. Write a menubar nav with at least one group:

    {% nav layout="menubar" %}
    ## Docs
    - getting-started
    - installation
    {% /nav %}
    
  2. Load the page with behaviours enabled, and inspect the group heading.

  3. Tab to the heading and press ArrowDown, then Escape.

Expected

The behaviour wires each group as a WAI-ARIA menubar item, as its own doc comment describes:

  • the heading gets role="button", tabindex="0", aria-haspopup and aria-expanded, with an id the panel references;
  • a click toggles the group's data-open, and only one group is open at a time;
  • ArrowLeft and ArrowRight move between triggers, ArrowDown enters the open submenu, and Escape closes it and returns focus.

Actual

None of that happens: no group is wired. The panels still open on hover and on :focus-within, through the skeleton's fallback rules (packages/skeleton/styles/runes/nav.css:80–82), so mouse users see working dropdowns and the defect is easy to miss. Keyboard and screen-reader users get no menubar semantics: no roles, no expanded state, no arrow-key navigation, and no Escape.

Environment

  • main as of 2026-11-09.
  • There is no behaviour test for the menubar. Nav tests in packages/runes/test cover the schema and auto-enrichment, not navMenubarBehavior.

Approach

  • Select the panel as :scope > [data-name="panel"], the element SPEC-054 introduced and the CSS already styles. That is also the selector SPEC-196 D6 asks for, since it uses the vocabulary rather than an element name.
  • Check the other :scope > … lookups in the same file against the current output, notably the mobile trigger (:scope > [data-name="trigger"]).
  • Add a DOM test (jsdom, as the other behaviour tests use) that renders a menubar nav through the real schema and asserts the roles and the keyboard model, so the schema and the behaviour cannot drift apart again.

References

  • SPEC-196 D6: the behaviour audit that found it.
  • SPEC-054: the panel wrapper.