Combobox.Option: disabled options are not exposed as aria-disabled
Dependencies check up
- I have verified that I use latest version of all @mantine/* packages (9.6.2)
What version of @mantine/* packages do you have in package.json?
9.6.2
What package has an issue?
@mantine/core
What framework do you use?
Other, I will specify in the steps to reproduce
In which browsers you can reproduce the issue?
All
Describe the bug
Combobox.Option with disabled renders data-combobox-disabled on the role="option"
element, but never aria-disabled="true". The same happens in the components built on
OptionsDropdown (Select, MultiSelect) when an item of data has disabled: true.
Keyboard navigation already skips disabled options, but assistive technology in browse/virtual
cursor mode still reads them as available options, without "unavailable"/"dimmed".
WAI-ARIA APG listbox and combobox patterns expect aria-disabled="true" on disabled options,
and other libraries do so (React Aria useOption, MUI Autocomplete getOptionDisabled,
rc-select/Ant Design).
If possible, include a link to a codesandbox with a minimal reproduction
<Select
label="Country"
data={[
{ value: 'br', label: 'Brazil' },
{ value: 'ar', label: 'Argentina', disabled: true },
]}
/>Open the dropdown and inspect the "Argentina" option: it has data-combobox-disabled="true",
but no aria-disabled.
Possible fix
In ComboboxOption, set 'aria-disabled': disabled || undefined next to the
combobox-disabled mod.
Self-service
- I would be willing to implement a fix for this issue
Source: mantinedev/mantine