shoppie icon indicating copy to clipboard operation
shoppie copied to clipboard

Mobile navigation

Open codeCraft-Ritik opened this issue 8 months ago • 0 comments

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

  1. Screen reader users cannot reliably know whether the menu is open or closed.
  2. Navigation becomes confusing, increasing bounce risk on mobile.
  3. 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.

codeCraft-Ritik avatar Mar 15 '26 06:03 codeCraft-Ritik