shoppie
shoppie copied to clipboard
Mobile navigation
Title
Mobile navigation toggle is not accessible: missing ARIA state and control relationship
Severity
High (user navigation blocked for assistive technology users on mobile)
Problem
The mobile menu opens/closes visually, but assistive tech does not get state updates. The toggle button has only a static label and does not expose expanded/collapsed state. The controlled menu is not linked via ARIA control semantics.
User Impact
- Screen reader users cannot reliably know whether the menu is open or closed.
- Navigation becomes confusing, increasing bounce risk on mobile.
- Accessibility conformance risk (WCAG 4.1.2 Name, Role, Value and 2.1.1 Keyboard if behavior is not consistently exposed).
Best Fix Approach
- Add a stable id to the nav element.
- Add aria-controls and aria-expanded=false to the toggle button.
- In JS, on each toggle:
- Determine open state.
- Set aria-expanded accordingly.
- Optionally set aria-hidden on nav for stronger AT signaling.
- Optional hardening:
- Close menu on Escape.
- Return focus to toggle when closing via Escape.
- Lock body scroll while menu is open on small screens.