Skip to content

[6.x] Fix duplicate burger ARIA id and empty-state heading order - #15572

Merged
jackmcdade merged 1 commit into
6.xfrom
fix/15409-burger-id-and-heading-order
Oct 13, 2026
Merged

jackmcdade merged 1 commit into
6.xfrom
fix/15409-burger-id-and-heading-order

Conversation

@jaygeorge

Copy link
Copy Markdown
Contributor

Description of the Problem

Two CP accessibility issues from #15409:

  1. The burger menu SVG (burger-menu-no-border.svg) had a hardcoded title id referenced by aria-labelledby. Because the icon is inlined in two places in the header, the page emitted duplicate ARIA ids (duplicate-id-aria).
  2. Empty-state screens jumped from the page <h1> to item <h3>s with no <h2>, which axe flags as heading-order (dashboard empty state, collections, taxonomies, navigation, fieldsets, roles, groups, etc.).

What this PR Does

  1. Makes the burger SVG decorative (aria-hidden="true") and removes the title / labelledby / role markup. The toggle button already has its own accessible name via aria-label.
  2. Gives empty states a proper outline: EmptyStateMenu heading is an h2 (via a new CardPanel level prop), and EmptyStateItem headings default to h3 (overridable with a level prop).
  3. Adds a Vitest covering the h2 → h3 hierarchy.

Visual appearance is unchanged (heading styles come from size, not the tag; burger paths are identical).

Fixes #15409

How to Reproduce

  1. On 6.x, open /cp/playground (or any CP page) and run:
    document.querySelectorAll('#burger-menu-title').length → > 1
  2. Open an empty-state screen (e.g. /cp/roles or /cp/fieldsets with no items) and run:
    [...document.querySelectorAll('h1,h2,h3')].map(h => h.tagName) → H1 then H3s
  3. On this branch, hard-reload and repeat:
    • burger id count → 0
    • headings → H1, H2 (menu), then H3s (items)

Make the nav toggle icon decorative so inlined SVGs no longer share a title id, and nest EmptyState headings as h2/h3 under the page h1.
@jackmcdade
jackmcdade merged commit 4e6c2bd into 6.x Oct 13, 2026
65 checks passed
@jackmcdade
jackmcdade deleted the fix/15409-burger-id-and-heading-order branch October 13, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate ARIA id on the burger icon, and a skipped heading level on seven screens

2 participants