Skip to content

Conversation

@andrewhick
Copy link
Contributor

@andrewhick andrewhick commented Jun 5, 2025

What’s changed

This PR removes unnecessary ARIA labels from the menu container and the main content window.

These aria-labels are used incorrectly as they are applied to <div> elements with no role. This is not permitted under the ARIA specification as a <div> has a role of generic. They are also unnecessary as:

  • the <nav> element already has an appropriate label
  • the main content is within a main landmark and so an aria-label is unnecessary for its container. We could move the aria-label to <main> instead but while permitted, my understanding is that it would be unnecessary.

I've tested it locally using VoiceOver and:

  • the side navigation is correctly noted as "Table of contents"
  • the main landmark is correctly identified as main

I believe this fixes #404 .

Identifying a user need

This came out of testing by Shabana Ali in the WCAG Primer working group, who identified the incorrect ARIA usage. We believe fails Web Content Accessibility Guidelines (4.1.2 Name, Role, Value - level A)

Copy link
Contributor

@tombye tombye left a comment

Choose a reason for hiding this comment

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

Thanks for this Andrew. It is odd these <div>s having labels but no role and that's reflected in the experience using a screen reader. This makes it better and, actually, doesn't lose any semantics because the table of contents is already wrapped in a <nav> and the content a <main>, both of which do a good job of describing what each contain.

Nice work, only adds value 👍🏻

@andrewhick andrewhick merged commit 556b4ac into main Jun 16, 2025
3 checks passed
@andrewhick andrewhick deleted the fix-aria-labels branch June 16, 2025 07:41
@romaricpascal romaricpascal mentioned this pull request Jun 17, 2025
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.

Bug: Menu and content containers use aria-label incorrectly

3 participants