Repository navigation
feat(a11y): implement roving tabindex grid navigation for Marketplace… - #1485
Open
digofavour-hub wants to merge 1 commit into
Open
digofavour-hub wants to merge 1 commit into
digofavour-hub wants to merge 1 commit into
Conversation
|
@digofavour-hub Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #1413
Summary
Implements the roving tabindex keyboard navigation pattern for the Marketplace API card grid so keyboard users have a single tab stop for the grid and can navigate between cards using arrow keys,
Home/End, andCtrl+Home/Ctrl+End.Changes
src/hooks/useRovingGrid.ts: New hook that tracks the active card index, computes visual rows/columns dynamically fromoffsetTop, handlesArrowLeft/ArrowRight(±1),ArrowUp/ArrowDown(±columns, clamped, no wrap),Home/End(row start/end), andCtrl+Home/Ctrl+End(grid start/end), ignores key events from inner interactive controls (button,input, etc.), and resets/clamps when dependencies or item counts change.src/components/ApiCard.tsx: Added optionaltabIndex(default0) andonFocusprops to preserve backwards compatibility at all other call sites.src/pages/MarketplacePage.tsx: WireduseRovingGridinto.marketplace-gridwithrole="group"andaria-label="Marketplace APIs"(preservingrole="button"onApiCardand avoiding invalidrole="grid"nesting), resetting active index on page, filter, or density changes.src/hooks/useRovingGrid.test.tsx: Unit tests stubbingoffsetTopfor a 3-column grid covering arrow navigation, clamping, partial last row,Home/End,Ctrl+Home/Ctrl+End, inner button/input event ignoring, and reset/clamping.src/pages/MarketplacePage.test.tsx: Added integration test asserting a singletabindex="0"card in the grid, arrow-key focus movement, and preservation of theccompare shortcut.