fix(app-webdir-ui): correct DOM order of WebDirectory controls for keyboard focus#1671
Open
juanmitriatti wants to merge 1 commit intodevfrom
Open
fix(app-webdir-ui): correct DOM order of WebDirectory controls for keyboard focus#1671juanmitriatti wants to merge 1 commit intodevfrom
juanmitriatti wants to merge 1 commit intodevfrom
Conversation
…yboard focus Reorder JSX children in WebDirLayout so DOM order matches visual order: View → Sort by → Filter by Last Initial. Fixes WCAG 2.1 SC 2.4.3 (Focus Order).
Collaborator
|
Storybook deployed at https://unity-uds-staging.s3.us-west-2.amazonaws.com/pr-1671/index.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: fix(app-webdir-ui): correct DOM order for WCAG 2.4.3 focus order
Description
Problem: The WebDirectory component renders its three controls (Filter by Last Initial, View,
Sort by) in the wrong DOM order. CSS Grid repositions them visually, but keyboard focus (Tab
key) follows DOM source order, causing screen readers and keyboard users to experience them in
the wrong sequence. This violates WCAG 2.1 SC 2.4.3 Focus Order (Level A).
Solution: Reorder the JSX children inside so DOM order matches visual/semantic
order:
No CSS or logic changes needed — the existing grid-area assignments continue to place elements
in the correct visual positions.
Testing Steps:
Open the Departments story with alphaFilter enabled Navigate to the staging Storybook URL: https://unity-uds-staging.s3.us-west-2.amazonaws.com/pr-1671/@asu/app-webdir-ui/iframe.html?args=alphaFilter%3Atrue&id=organisms-web-directory-templates--web-directory-example-departments&viewMode=story Confirm the page renders with three visible controls: View (grid/list toggle), Sort by (dropdown), and Filter By Last Initial (A–Z buttons).
Verify visual order Visually confirm the controls appear on screen in this top-to-bottom order:
View (grid/list icons) — topmost
Sort by (dropdown) — second
Filter By Last Initial (alphabet buttons) — third
Verify keyboard tab order Click somewhere before the web directory component (e.g., the page body above it), then press Tab repeatedly and confirm focus moves in this order:
1st → View buttons (Grid view / List view)
2nd → Sort by dropdown
3rd → Filter By Last Initial radiogroup (All, A, B, C…)
Confirm the old broken order is no longer reproducible On the same page, confirm that focus does not jump to Filter By Last Initial first before visiting View or Sort by. The previously broken order was Filter by → View → Sort by — tabbing through the controls should never reach the alphabet filter buttons before the View toggle and Sort dropdown have received focus.
Check the People story Switch to Web Directory Example People in the sidebar. Repeat the Tab key test. Expected keyboard order: View → Sort by (no alpha filter on this story, confirm no regression).
Check the Departments And People story Switch to Web Directory Example Departments And People. Run the same Tab key check and confirm the correct order: View → Sort by → Filter By Last Initial. Note: this story has a pre-existing aria-prohibited-attr violation on the address card — confirm it is unrelated to the tab order controls.