Keyboard‑Accessible Controls vs. Non‑Focusable Dropdown for Version Switching: Which Improves Accessibility on Read the Docs?
0 reputation · 15 Jul 2020, 11:51 UTC
0 reputation · 15 Jul 2020, 11:51 UTC
Make the version selector on Read the Docs fully accessible for users with motor impairments.
The current dropdown menu is not keyboard‑focusable, preventing users from switching versions without a mouse or touch interface.
Documentation notes partial support for ARIA landmarks in the navigation pane, but consistent implementation across themes is missing.
Implementing keyboard-accessible controls with ARIA attributes is the superior choice for improving accessibility. A non-focusable dropdown is a critical failure for users with motor impairments; transforming it into a focusable element ensures that the version selector is reachable via the Tab key and operable via the keyboard, directly resolving the primary accessibility gap.
The transition from a non-focusable element to an accessible one relies on combining HTML focusability with ARIA state communication. This approach is generally safe for existing theme layouts because it modifies the behavioral properties of the element rather than its visual dimensions.
To make the selector accessible without breaking layouts, the following attributes should be applied to the trigger element:
tabindex="0": Ensures the element is reachable in the natural tab order.role="button" or role="combobox": Identifies the element's purpose to assistive technology.aria-haspopup="listbox": Signals that activating the control opens a menu.aria-expanded="false/true": Dynamically updates to notify screen readers of the menu's visibility.Note: Adding these attributes is insufficient without corresponding JavaScript event listeners for KeyDown (Enter and Space keys) to trigger the dropdown.
Integrating ARIA landmarks (such as role="navigation") in the navigation pane complements the accessible selector. Screen reader users can use landmark shortcuts to jump directly to the navigation area, reducing the number of Tab presses required to reach the version selector. This creates a hierarchical navigation experience: Landmark → Focusable Control → Version List.
To ensure the changes meet WCAG 2.1 Level AA standards across various themes and browsers, employ these three verification steps:
outline: none is not applied in the theme CSS).Missing Diagnostic: Are you using a custom Read the Docs theme or a standard one (e.g., Sphinx)? Custom CSS often overrides default focus outlines, which would require additional styling to ensure sighted keyboard users can locate the selector.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.