Skip to content

[@mantine/core] Combobox: Set aria-disabled on disabled Combobox.Option - #9236

Merged
rtivital merged 2 commits into
mantinedev:masterfrom
lavinhoque33:fix/combobox-option-aria-disabled
Oct 6, 2026
Merged

rtivital merged 2 commits into
mantinedev:masterfrom
lavinhoque33:fix/combobox-option-aria-disabled

Conversation

@lavinhoque33

Copy link
Copy Markdown
Contributor

Bug

Combobox.Option with disabled renders data-combobox-disabled on the role="option" element but never aria-disabled. Keyboard navigation already skips the option, but assistive technology in browse/virtual-cursor mode still announces it as available. The same applies to Select / MultiSelect items with disabled: true, which render through OptionsDropdown.

Fix

Set aria-disabled="true" on the option element when disabled is set, and omit the attribute otherwise, as the WAI-ARIA APG listbox and combobox patterns expect. OptionsDropdown already forwards disabled to Combobox.Option, so Select, MultiSelect, Autocomplete and TagsInput pick this up without further changes.

Closes #9233

Testing

  • ComboboxOption.test.tsx: asserts aria-disabled="true" when disabled and that the attribute is absent otherwise. Fails on master.
  • Select.test.tsx: dropdownOpened with one disabled item; only that option carries aria-disabled. Fails on master.
  • Combobox, Select, MultiSelect, Autocomplete and TagsInput suites: 25 suites / 805 tests passing.
  • oxlint and oxfmt run on the changed files.

Copilot AI balanced review requested due to automatic review settings October 2, 2026 02:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The new rerender test remounts the component instead of verifying attribute removal after a prop update.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds assistive-technology support for disabled combobox options.

Changes:

  • Adds aria-disabled to disabled Combobox.Option elements.
  • Adds direct and Select integration tests.
File Description
ComboboxOption.tsx Exposes disabled state through ARIA.
ComboboxOption.test.tsx Tests disabled ARIA behavior.
Select.test.tsx Verifies propagation to Select options.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@lavinhoque33
lavinhoque33 force-pushed the fix/combobox-option-aria-disabled branch from 09c4088 to f522649 Compare October 2, 2026 02:44
@rtivital rtivital added the Verified Reviewed and verified PR label Oct 4, 2026
@rtivital
rtivital merged commit 62f2ce8 into mantinedev:master Oct 6, 2026
1 check passed
@rtivital

rtivital commented Oct 6, 2026

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Verified Reviewed and verified PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combobox.Option: disabled options are not exposed as aria-disabled

3 participants