Skip to content

Fix: add aria-controls to combobox input when open - #213

Merged
dmcnamara-eng merged 1 commit into
GavinJoyce:masterfrom
linds-wmce:fix/combobox-input-aria-controls
Oct 16, 2026
Merged

dmcnamara-eng merged 1 commit into
GavinJoyce:masterfrom
linds-wmce:fix/combobox-input-aria-controls

Conversation

@linds-wmce

Copy link
Copy Markdown
Contributor

What

Combobox.Input now sets aria-controls to the options listbox id while the combobox is open, and removes it when closed.

Why

The input has role="combobox", so it should reference the listbox it controls when expanded. Combobox.Button already does this with aria-controls={{if @isOpen @guid}}; the input was missing the same attribute. Consumers currently have to patch it in with a custom modifier.

Testing

Added an integration test in the Combobox.Input module that checks the attribute is absent when closed, matches the listbox id when open, and is gone again after closing. All combobox tests pass locally.

🤖 Generated with Claude Code

An input with role="combobox" must reference the listbox it controls
while expanded. The button already sets aria-controls; the input did not,
which axe flags as aria-required-attr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linds-wmce linds-wmce changed the title Add aria-controls to combobox input when open Fix: add aria-controls to combobox input when open Oct 16, 2026
@linds-wmce
linds-wmce marked this pull request as ready for review October 16, 2026 06:59
@linds-wmce

Copy link
Copy Markdown
Contributor Author

@dmcnamara-eng this is ready for review when you have a chance. I couldn't request you as a reviewer directly since I don't have write access here.

@dmcnamara-eng
dmcnamara-eng merged commit f6940c3 into GavinJoyce:master Oct 16, 2026
10 checks passed
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