Skip to content

docs: make version selector keyboard accessible - #2726

Draft
kfenner wants to merge 1 commit into
mainfrom
kaspar-fenner-docs-version-selector-click
Draft

docs: make version selector keyboard accessible#2726
kfenner wants to merge 1 commit into
mainfrom
kaspar-fenner-docs-version-selector-click

Conversation

@kfenner

@kfenner kfenner commented Sep 4, 2026

Copy link
Copy Markdown
Member

Description

Follow-up to #2723. The click-only version selector could not be opened or operated with the keyboard because the hover override also disabled Material's :focus-within path.

This implements a WAI-ARIA disclosure navigation pattern (same class of control as MDN / many docs version switchers):

  • Native button with aria-expanded / aria-controls (no aria-haspopup)
  • Real links in a ul, hidden when closed, aria-current="page" on the current version
  • Click to toggle; hover does not open
  • Tab into the list when open; Arrow / Home / End; Escape closes and returns focus
  • Dropdown sits below the button so a second click closes instead of activating a version
  • Panel is lifted from the header so it remains readable in light and dark

Tested by injecting the new CSS/JS into https://element.siemens.io/development/ (click, click-again, hover, Tab, arrows, Escape, ARIA, light/dark).

Backports to v49 and v48 are intentionally not included yet.

Testing

  • Injected CSS/JS against live development docs
  • Docs build on this branch (reviewer)

Documentation.
Examples.
Dashboards Demo.
Playwright report.

Coverage Reports:

Code Coverage

Replace the click-only override with a WAI-ARIA disclosure navigation
pattern so the docs version switcher is operable by mouse and keyboard.

The previous hover disable also removed Material's :focus-within open
path, so Tab never reached the list. The button now uses aria-expanded
and aria-controls, the list is hidden until open, and Tab, arrows,
Home/End, and Escape move through the real version links.

Position the dropdown below the toggle so a second click closes it
instead of activating a version, and lift the panel from the header.
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.

1 participant