Repository navigation
[combobox][autocomplete] Remove aria-readonly prop from Clear and Popup components when readOnly - #3907
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Greptile OverviewGreptile SummaryRemoved Key changes:
Note: The Confidence Score: 5/5
Important Files Changed
|
| @@ -90,7 +90,6 @@ export const ComboboxClear = React.forwardRef(function ComboboxClear( | |||
| { | |||
| tabIndex: -1, | |||
| children: 'x', | |||
There was a problem hiding this comment.
For consistency with this change, consider also removing aria-readonly from ComboboxChipRemove component (line 57 in packages/react/src/combobox/chip-remove/ComboboxChipRemove.tsx) and updating its tests. The ComboboxChipRemove component is also a button that should not have aria-readonly for the same reasons as Clear and Trigger buttons.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/react/src/combobox/clear/ComboboxClear.tsx
Line: 92:92
Comment:
For consistency with this change, consider also removing `aria-readonly` from `ComboboxChipRemove` component (line 57 in `packages/react/src/combobox/chip-remove/ComboboxChipRemove.tsx`) and updating its tests. The `ComboboxChipRemove` component is also a button that should not have `aria-readonly` for the same reasons as Clear and Trigger buttons.
How can I resolve this? If you propose a fix, please make it concise.|
Failing test:
|
|
Thanks for the fix @markocupic024! |
…bobox trigger Follow-up to mui#5531, which added `aria-readonly` to `Select`'s listbox. `Combobox.List` (also `Autocomplete.List`) renders `role="listbox"` or `role="grid"`, both of which `aria-readonly` is defined for, and it carried no read-only state at all. `Combobox.Trigger` gets it only when it renders with `role="combobox"`, mirroring how `aria-required` is already gated: without that role the trigger is a plain button, where the attribute wouldn't apply (mui#3907), and the `Combobox.Input` outside the popup already exposes the state.
Closes #3906
readOnly has no effect these buttons