-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Describe the bug
The current implementation of the collapsible sidebar navigation uses div elements and custom JavaScript to function as an accordion. This non-semantic approach creates significant accessibility issues.
Assistive technologies, like screen readers, cannot properly interpret the role or state (expanded/collapsed) of these components. This results in a poor user experience for individuals who rely on such technology.
I propose replacing the current div-based implementation with the native HTML
elements. This would:
Provide full accessibility out-of-the-box for screen reader and keyboard-only users.
Reduce custom JavaScript and engineering complexity by leveraging native browser behavior.
Align the component with modern web standards and semantic best practices.
Reproduction
Navigate to any page in the VitePress documentation that uses a collapsible container, such as the Vitepress Docs.
Attempt to navigate the sidebar with a screen reader (e.g., VoiceOver, NVDA, JAWS). The screen reader fails to announce it as a collapsible element or communicate its state.
Expected behavior
For sidebar to look and function exactly as it does now but with better accessibility.
System Info
JAWS, NVDA, VOICEOVER
JAWS, NVDA, VOICEOVER