feat: accessible search combobox#519
Open
NnamdiCyber wants to merge 1 commit into
Open
Conversation
Implements app/components/SearchInput.tsx following the WAI-ARIA 1.2 combobox pattern (§5.9) with full keyboard navigation. ARIA wiring - role=combobox on input; aria-expanded, aria-haspopup=listbox, aria-autocomplete=list, aria-controls, aria-activedescendant - role=option + aria-selected on each listbox item - aria-live=polite status region announces result counts, loading, and empty states to screen-reader users - Clear button has aria-label='Clear search' and is tab-accessible Keyboard interaction - ArrowDown / ArrowUp navigate options with wrap-around - Home / End jump to first / last option - Enter confirm highlighted option or submit free-text - Escape close listbox; second press clears value - Tab close listbox, natural focus flow API - Controlled (value + onChange) and uncontrolled modes - suggestions[], onSelect, onSubmit, onOpen, onClose callbacks - isLoading, disabled, maxSuggestions, aria-label, aria-labelledby props - Design-system tokens (bg-popover, accent, border-input) with motion-safe: utilities for prefers-reduced-motion compliance Tests (app/components/__tests__/SearchInput.test.tsx) ~50 focused cases covering ARIA wiring, all keyboard paths, click/hover, clear button, loading/empty states, controlled vs uncontrolled, maxSuggestions, disabled, live region, outside-click close, and a snapshot. Docs: docs/SEARCH_INPUT.md — props table, keyboard table, usage examples, comparison with the navbar-specific SearchInput. Closes Predictify-org#477
|
@NnamdiCyber is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@NnamdiCyber 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.
Summary
Implements
app/components/SearchInput.tsx— a general-purpose accessiblesearch input following the WAI-ARIA 1.2 combobox pattern (§5.9).
Closes #477
Changes
app/components/SearchInput.tsxapp/components/__tests__/SearchInput.test.tsxdocs/SEARCH_INPUT.mdARIA wiring
role="combobox"witharia-expanded,aria-haspopup="listbox",aria-autocomplete="list",aria-controls,aria-activedescendantrole="option"+aria-selectedon each listbox itemaria-live="polite"status region announces result counts, loading, empty statesaria-label="Clear search", keyboard-reachableKeyboard interaction
Tests
~50 cases: full ARIA wiring, all keyboard paths with wrap-around, click/hover,
outside-click close, clear button focus return, isLoading, no-results, controlled
vs uncontrolled, maxSuggestions, disabled, live-region, snapshot.
Run with:
pnpm test app/components/__tests__/SearchInput.test.tsxDocs
docs/SEARCH_INPUT.md— props table, keyboard table, usage examples.