Skip to content

feat(a11y): enhance label and state for view all button#229

Merged
Jezzamonn merged 3 commits into
google:mainfrom
KenTandrian:a11y/label-and-state-for-view-all-btn
Dec 21, 2025
Merged

feat(a11y): enhance label and state for view all button#229
Jezzamonn merged 3 commits into
google:mainfrom
KenTandrian:a11y/label-and-state-for-view-all-btn

Conversation

@KenTandrian

Copy link
Copy Markdown
Collaborator

This PR improves the accessibility of the "View All" (hamburger) menu button by ensuring it correctly announces its purpose and current state to screen reader users.

Changes

  • Contextual labels: Updated the button's label in santa-chrome.js to change based on context. It now clearly announces "Santa's Village" when acting as a Home button and "View All Menu" when acting as the main menu toggle.
  • State tracking with aria-expanded: Added dynamic support for the aria-expanded attribute to santa-button.js. This allows the button to correctly communicate whether the navigation menu is currently collapsed or expanded.
  • Cleaner DOM with ifDefined: Implemented ifDefined in both the parent and child components. This ensures that accessibility attributes like aria-expanded are completely removed from the DOM when they aren't applicable (e.g., when the button is in "Home" mode), avoiding invalid states.

Impacted UI components

  • Navigation Menu Button: The main toggle for the side navigation.
  • Santa Button: The shared button component used throughout the header.

@KenTandrian

Copy link
Copy Markdown
Collaborator Author

Expanded:

expanded

Collapsed:

collapsed

@Jezzamonn

Copy link
Copy Markdown
Collaborator

Nice! We'll need to update our internal translations for the other languages too, but good to fix this for English for the moment.

@Jezzamonn Jezzamonn merged commit 9034f14 into google:main Dec 21, 2025
1 check passed
@KenTandrian KenTandrian deleted the a11y/label-and-state-for-view-all-btn branch December 22, 2025 02:00
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.

3 participants