Skip to content

fix(combobox): set aria-controls on the combobox element while open (0.10.x) - #3290

Merged
interactivellama merged 1 commit into
0.10.xfrom
fix/0.10.x-combobox-aria-controls
Nov 10, 2026
Merged

interactivellama merged 1 commit into
0.10.xfrom
fix/0.10.x-combobox-aria-controls

Conversation

@interactivellama

Copy link
Copy Markdown
Contributor

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 with role="combobox" has aria-expanded="true" but no aria-controls (reported against 0.10.65).

Root cause: the SLDS markup puts role="combobox" on the .slds-combobox wrapper and role="textbox" on the input. aria-controls was 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-controls on the wrapper:

  • base, inline-listbox and readonly: ${id}-listbox, set only when the listbox renders (!disabled && isOpen, matching getDialog). The input reuses the same value.
  • popover: ${popoverId}-popover, following an id set through popover props.

Also drops the jsx-a11y/role-has-required-aria-props eslint-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 added aria-controls line.

The version bump to 0.10.66 is a separate release PR.


CONTRIBUTOR checklist (do not remove)

Please complete for every pull request

REVIEWER checklist (do not remove)

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.
@interactivellama
interactivellama merged commit b3189df into 0.10.x Nov 10, 2026
6 checks passed
@interactivellama
interactivellama deleted the fix/0.10.x-combobox-aria-controls branch November 10, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants