Repository navigation
fix(selector): hasSearch input is the combobox with aria-activedescendant (comboboxes-4) - #3402
Conversation
…endant (comboboxes-4)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
nynexman4464
left a comment
There was a problem hiding this comment.
One minor thing I noticed here. In the accessibility tree view I noticed the role switches from "button" to "combobox" on enter. I checked a few other searchable, which had role "combobox" to start. I guess maybe because in this case we had the "clear" button the combobox role doesn't work well (actually I think we may have talked about this once before).
Anyhow I tested with keyboard and saw the active descendant etc seem to be updating appropriately, arrow keys work, enter and esc work.
One bug with multi-selector: using arrow keys didn't scroll the active item into view. Would be nice to fix (could be a different PR):
Screen.Recording.2026-07-02.at.12.07.59.PM.mov
Another minor nit: we don't currently show a searchable example on the Selector doc page. Might be a nice add.
Part of the accessibility & keyboard-management program (#3343). Fixes finding
comboboxes-4.Problem
In
hasSearchmode,Selector/MultiSelectormove focus into the popup's search input on open — but that input was a barerole="searchbox"with onlyaria-controlsand anaria-label. Thearia-activedescendantthat reports the highlighted option stayed on the trigger, which no longer had focus. So a screen-reader user typing to filter heard nothing as ArrowUp/Down moved the highlight: the attribute reporting the highlight was on an element they had left.Fix
The search input is now the combobox (APG combobox-with-listbox-popup):
role="combobox",aria-expanded,aria-autocomplete="list",aria-controls={listbox}, andaria-activedescendantpointing at the highlighted option — so highlight changes are announced on the focused element.<button>(keepingaria-haspopup="listbox"/aria-expandedto open the popup) whenhasSearchis set; it staysrole="combobox"in the default (no-search) mode where the trigger itself hosts the value and activedescendant.Tests
Selector + MultiSelector
hasSearchtests updated to reflect the trigger-is-a-button / search-input-is-combobox structure, plus a new assertion that the search input carriesaria-autocomplete="list",aria-expanded,aria-controls, and gainsaria-activedescendantafter ArrowDown. Full Selector + MultiSelector suites green (67 tests), typecheck (incl. tests) + lint clean.