Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve table of contents accessibility #205

Merged
merged 1 commit into from
Feb 17, 2021
Merged

Conversation

danacotoran
Copy link
Contributor

@danacotoran danacotoran commented Feb 16, 2021

The table of contents fails WCAG 2.4.3.
When the table of contents is expanded, a search field and a list of (sometimes) collapsible options appear. Focus is automatically set to the first link on the list, which means that screen reader users might miss both the search box and the "hide table of contents" button.
The changes introduced in this PR ensure that focus is not set on the first nav option, but on the entire region. This way when the user navigates forward, they are able to encounter the search box and the "close" button.

Additionally, adjust the markup for the open/close TOC buttons to use the <button> element instead of an anchor tag. The reason is that these elements both look and behave as buttons, not as links. This should aid assistive tech users in navigating this functionality (for ex using voice control)

Trello card: https://trello.com/c/vv0OR35g/630-march-update-tech-docs-template

Copy link
Contributor

@kr8n3r kr8n3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, good improvement. tested locally

The table of contents fails WCAG 2.4.3. When the table of contents is
expanded, a search field and a list of (sometimes) collapsible options
appears. Focus is automatically set to the first link on the list, which
means that screen reader users might miss both the search box and the
"hide table of contents" button.
The changes introduced in this PR ensure that focus is not set on the
first nav option, but on the entire region. This way when the user
navigates forward, they are able to encounter the search box and the
"close" button.

Additionally, adjust the markup for the open/close TOC buttons to use
the <button> element instead of an anchor tag. The reason is that these
elements both look and behave as buttons, not as links. This should aid
assistive tech users in navigating this functionality (for ex using
voice control)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants