Repository navigation
fix(combobox): set aria-controls on the combobox element while open (0.10.x) - #3290
Merged
Merged
Conversation
The SLDS markup puts role="combobox" on the .slds-combobox wrapper and role="textbox" on the input, but aria-controls was only set on the input. An expanded role="combobox" without aria-controls fails axe aria-required-attr (W-24839159). Set aria-controls on the wrapper in all six render paths: the listbox id for base, inline-listbox and readonly, and the dialog id (following any id set through popover props) for variant="popover". It is set only while the target is rendered, and the input uses the same value. Drop the now-stale jsx-a11y/role-has-required-aria-props disables. Backport of the master fix.
This was referenced Nov 10, 2026
Niznikr
approved these changes
Nov 10, 2026
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.
Fixes W-24839159
Additional description
Backport of #3289 to the 0.10.x maintenance line.
Symptom: with the Combobox menu open, axe reports
aria-required-attr: the element withrole="combobox"hasaria-expanded="true"but noaria-controls(reported against 0.10.65).Root cause: the SLDS markup puts
role="combobox"on the.slds-comboboxwrapper androle="textbox"on the input.aria-controlswas only set on the input, in all six render paths: base, inline-listbox single and multiple, readonly single and multiple, and popover.Fix: set
aria-controlson the wrapper:${id}-listbox, set only when the listbox renders (!disabled && isOpen, matchinggetDialog). The input reuses the same value.${popoverId}-popover, following anidset throughpopoverprops.Also drops the
jsx-a11y/role-has-required-aria-propseslint-disable comments, which lint no longer needs.Tests: new karma cases in
combobox.browser-test.jsx(open and closed/disabled per variant, plus the custom popover id case). The open-state cases fail without the fix. 13 open-state Storyshots change, each only by the addedaria-controlsline.The version bump to 0.10.66 is a separate release PR.
CONTRIBUTOR checklist (do not remove)
Please complete for every pull request
npm run lint:fixhas been run and linting passes. (ESLint and Prettier oncomponents/combobox)components/component-docs.jsonCI tests pass (npm test). (Karma unit, 679 passed; Storyshots, 465 passed; docs test not run)REVIEWER checklist (do not remove)
components/component-docs.jsontests.