You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Selector's trigger has no accessible name, and its role changes with hasSearch #4450
Selector's trigger button has no accessible name, and the markup it renders differs depending on hasSearch in a way that makes it impossible to target by role in either case.
Verified against @astryxdesign/[email protected] in Chromium, with label supplied through the component's own prop.
What renders
Two Selectors on the same page, both given a label. Read off the trigger <button>:
hasSearch
role
aria-label
aria-labelledby
text content
absent
combobox
null
null
the placeholder
true
(none)
null
null
the placeholder
Why each is a problem
Without hasSearch the trigger is <button role="combobox">. combobox is not a name-from-content role, so the placeholder text does not name it, and with no aria-label or aria-labelledby the accessible name computes to empty. A screen reader announces "collapsed, combobox" with no indication of which field it is. The visible label is rendered as a sibling element that is not associated with the control.
With hasSearch the same component renders a plain <button> with no role. That is name-from-content, so it does get a name — but the name is the placeholder ("Select a branch…"), not the label. Better than empty, still not the field's name, and it also loses the combobox role that conveys the control's behaviour.
Expected
The value passed to label should name the trigger in both shapes — via aria-labelledby pointing at the rendered label, or aria-label when the label is visually hidden — and the role should not depend on whether a search box is enabled.
Impact
On a form of several Selectors, every one announces identically. It also means neither getByRole('button', { name }) nor getByRole('combobox', { name }) matches the trigger, so automated tests and any assistive-tech user hit the same wall: consumers end up adding their own data-* hook to locate it, which does nothing for screen-reader users.
Fixed in #4604 — the trigger button now references the Field label via aria-labelledby, so the accessible name resolves to the label prop in both hasSearch modes.
Two more effects of the role-less hasSearch trigger, still on main (14fc587) and in 0.7.4, for Selector and MultiSelector (#6991 gave only ComplexSelectorrole="combobox"):
The chosen value is not exposed. Since fix(#4450): give Selector trigger an accessible name via aria-labelledby #4604 the trigger is named by aria-labelledby pointing at the field label (Selector.tsx:1930), and with no role (Selector.tsx:2030) it is a plain button, so its content (the selected option) is neither its name nor a value. A screen reader hears "Fruit, button" with no "Apple". Without hasSearch the same Selector is a combobox whose value is "Apple".
aria-required is dropped.aria-required is not supported on button, so Chromium does not expose it. With an explicit isRequired the label's "Required" text still reaches the name, but under FormLayout defaultOptionality="required" the trigger is just "Fruit", while the non-search Selector next to it reports required: true. MultiSelector has the same two lines (MultiSelector.tsx:2461-2462, :2637).
Chromium 156 accessibility tree: button "Fruit" (no value, no required) and combobox "Plain", value "Apple", required: true. Giving the search trigger role="combobox" too, as #6991 did, would fix both.
My 31 July comment above said this was fixed. It wasn't, and that comment is wrong. #4604 was closed unmerged: the reviewer's point stands — the native <label for> association already names the trigger, so the explicit aria-labelledby added nothing — and nothing in that PR ever touched required or value. The issue should not have been reported as closed. Both effects duytbp lists are still on main (aa4bd1d), at Selector.tsx:2111 and MultiSelector.tsx:2665, and I can reproduce them from the repro above.
A third one, same root cause, and worth fixing in the same patch: with renderTrigger, MultiSelector cannot be repaired by the caller at all. MultiSelectorRenderTriggerProps hands back aria-haspopup, aria-expanded, aria-controls, aria-busy and aria-readonly — but no role, no aria-required, no aria-disabled. ComplexSelectorRenderTriggerProps gained all three in #6991, so a caller-owned control there can be a combobox; here it has to guess. Whatever you decide about the trigger role, the handoff should carry the same set.
On the fix itself, role="combobox" on the search trigger as #6991 did is the right end state, but it is not a one-line change, and I don't think it should be presented as one. #3402 (ac17c7fc2) deliberately removed that role — "the popup's search input is the combobox … the trigger is a plain button that opens the listbox — not a second combobox" — and the decision is pinned in five places:
Selector/__tests__/Combobox.a11y.states.ts:122 — the Selector trigger with hasSearch exclusion
Selector/Selector.test.tsx:222, :794, :1119, :1635 — every hasSearch test locates the trigger as getByRole('button'), three of them with the comment "the trigger is a plain button, not a combobox"
Selector/__tests__/SelectorListboxName.a11y.chromium.spec.ts:43 — "The searchable trigger is a plain button until the list opens"
ARIA 1.2 only says the value belongs to the text input in an editable combobox; it doesn't forbid a second combobox, but it doesn't bless this one either. So the choice between "make the trigger a combobox" and "keep #3402's model and expose value/required another way" is a design decision for whoever owns that record, not something the bug report settles.
Whichever way it goes, required is the one that bites hardest today: under FormLayout defaultOptionality="required" the searchable trigger reports nothing at all, while the plain selector beside it reports required: true.
Activity
cixzhang commentedon Jul 28, 2026
Tracked in the accessibility program tracker: #4475
cixzhang commentedon Jul 28, 2026
Tracked in the accessibility program tracker: #4475
fix(meta#4450): give Selector trigger an accessible name via aria-lab…
gonzoblasco commentedon Jul 31, 2026
Fixed in #4604 — the trigger button now references the Field label via
aria-labelledby, so the accessible name resolves to thelabelprop in bothhasSearchmodes.fix(meta#4450): give Selector trigger an accessible name via aria-lab…
fix(meta#4450): give Selector trigger an accessible name via aria-lab…
duytbp commentedon Oct 30, 2026
Two more effects of the role-less
hasSearchtrigger, still on main (14fc587) and in 0.7.4, forSelectorandMultiSelector(#6991 gave onlyComplexSelectorrole="combobox"):aria-labelledbypointing at the field label (Selector.tsx:1930), and with no role (Selector.tsx:2030) it is a plain button, so its content (the selected option) is neither its name nor a value. A screen reader hears "Fruit, button" with no "Apple". WithouthasSearchthe same Selector is a combobox whose value is "Apple".aria-requiredis dropped.aria-requiredis not supported onbutton, so Chromium does not expose it. With an explicitisRequiredthe label's "Required" text still reaches the name, but underFormLayout defaultOptionality="required"the trigger is just "Fruit", while the non-search Selector next to it reportsrequired: true.MultiSelectorhas the same two lines (MultiSelector.tsx:2461-2462, :2637).Chromium 156 accessibility tree:
button "Fruit"(no value, no required) andcombobox "Plain", value "Apple",required: true. Giving the search triggerrole="combobox"too, as #6991 did, would fix both.gonzoblasco commentedon Nov 3, 2026
My 31 July comment above said this was fixed. It wasn't, and that comment is wrong. #4604 was closed unmerged: the reviewer's point stands — the native
<label for>association already names the trigger, so the explicitaria-labelledbyadded nothing — and nothing in that PR ever touchedrequiredorvalue. The issue should not have been reported as closed. Both effects duytbp lists are still onmain(aa4bd1d), at Selector.tsx:2111 and MultiSelector.tsx:2665, and I can reproduce them from the repro above.A third one, same root cause, and worth fixing in the same patch: with
renderTrigger,MultiSelectorcannot be repaired by the caller at all.MultiSelectorRenderTriggerPropshands backaria-haspopup,aria-expanded,aria-controls,aria-busyandaria-readonly— but norole, noaria-required, noaria-disabled.ComplexSelectorRenderTriggerPropsgained all three in #6991, so a caller-owned control there can be a combobox; here it has to guess. Whatever you decide about the trigger role, the handoff should carry the same set.On the fix itself,
role="combobox"on the search trigger as #6991 did is the right end state, but it is not a one-line change, and I don't think it should be presented as one. #3402 (ac17c7fc2) deliberately removed that role — "the popup's search input is the combobox … the trigger is a plain button that opens the listbox — not a second combobox" — and the decision is pinned in five places:Selector/__tests__/Combobox.a11y.states.ts:122— theSelector trigger with hasSearchexclusionSelector/Selector.test.tsx:222,:794,:1119,:1635— every hasSearch test locates the trigger asgetByRole('button'), three of them with the comment "the trigger is a plain button, not a combobox"Selector/__tests__/SelectorListboxName.a11y.chromium.spec.ts:43— "The searchable trigger is a plain button until the list opens"ARIA 1.2 only says the value belongs to the text input in an editable combobox; it doesn't forbid a second combobox, but it doesn't bless this one either. So the choice between "make the trigger a combobox" and "keep #3402's model and expose value/required another way" is a design decision for whoever owns that record, not something the bug report settles.
Whichever way it goes,
requiredis the one that bites hardest today: underFormLayout defaultOptionality="required"the searchable trigger reports nothing at all, while the plain selector beside it reportsrequired: true.