Skip to content

feat(a11y): enhance keyboard focus order in View All menu page#230

Merged
Jezzamonn merged 1 commit into
google:mainfrom
KenTandrian:a11y/keyboard-focus-order
Dec 21, 2025
Merged

feat(a11y): enhance keyboard focus order in View All menu page#230
Jezzamonn merged 1 commit into
google:mainfrom
KenTandrian:a11y/keyboard-focus-order

Conversation

@KenTandrian

Copy link
Copy Markdown
Collaborator

This PR fixes an accessibility issue in the "View All" menu where the keyboard focus order was unpredictable, causing the tab focus to zig-zag between rows instead of following a logical flow.

Changes

  • Synchronized DOM and Visual Order: Refactored the render method in santa-cardnav.js to pre-calculate the layout position of each card based on the existing bin-packing logic.
  • Sorted Rendering: The cards are now sorted by their calculated visual order before being rendered. This ensures that the DOM order matches the visual layout, guaranteeing a natural left-to-right, top-to-bottom tab sequence for keyboard users.
  • Preserved Layout Logic: Maintained the existing algorithm that optimally places "wide" video cards and backs-fills gaps with standard cards, but now the accessibility tree reflects this structure.

Impacted UI components

  • Card Navigation (santa-cardnav): The component responsible for rendering the "View All" grid menu.

@Jezzamonn

Copy link
Copy Markdown
Collaborator

Awesome!

@Jezzamonn
Jezzamonn merged commit d36d4bb into google:main Dec 21, 2025
1 check passed
@KenTandrian
KenTandrian deleted the a11y/keyboard-focus-order branch December 22, 2025 02:02
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