Skip to content

Conversation

@ritorhymes
Copy link

@ritorhymes ritorhymes commented Dec 26, 2025

Summary

Improves Table of Contents (ToC) navigation accessibility and keyboard behavior on mobile/tablet.

Changes

  • Convert the ToC wrapper to a semantic landmark <nav> with aria-label and a stable id for aria-controls.
  • Keep the nav toggle’s aria-expanded synced with the open/closed state.
  • Set aria-current="location" on the active ToC link and clear it from the previously active link.
  • Close the ToC via the Escape key when the nav toggle is visible.

Dependency

It is stacked on PR #241 since ensuring the page layout works normally is foundational for other a11y enhancements to be effective.

Testing

A live demo is available at zaproxy-api.ritovision.com

  • Mobile/tablet viewport: verified ToC opens/closes via the toggle, aria-expanded updates correctly, and Escape closes the ToC.
  • Verified the active ToC item updates aria-current as expected while scrolling/clicking ToC links.
  • Verified the ToC wrapper renders as a <nav> landmark with the expected attributes.

…age width on mobile

Signed-off-by: Rito Rhymes <83614463+ritorhymes@users.noreply.github.com>
…ntent underneath it

Signed-off-by: Rito Rhymes <83614463+ritorhymes@users.noreply.github.com>
Convert TOC wrapper to a semantic landmark with aria-label and a stable id for aria-controls.

Keep nav button aria-expanded synced on open/close.

Set aria-current='location' on the active ToC link and clear it from the previous active link.

Close the ToC via Escape key when the nav toggle is visible.

Signed-off-by: Rito Rhymes <83614463+ritorhymes@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant