-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[material-ui][Checkbox] Add aria-checked
attribute for indeterminate state in Checkbox component
#46497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…state in Checkbox component
Netlify deploy previewhttps://deploy-preview-46497--material-ui.netlify.app/ Bundle size report
|
@@ -171,6 +171,10 @@ const Checkbox = React.forwardRef(function Checkbox(inProps, ref) { | |||
: externalInputProps, | |||
{ | |||
'data-indeterminate': indeterminate, | |||
...(indeterminate && { | |||
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked#values | |||
'aria-checked': 'mixed', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taken from joy-ui
material-ui/packages/mui-joy/src/Checkbox/Checkbox.tsx
Lines 331 to 333 in 544079d
...(indeterminate && { | |
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked#values | |
'aria-checked': 'mixed' as const, |
aria-checked
attribute for indeterminate state in Checkbox component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ZeeshanTamboli Manually testing this seems unnecessary. The change made is to-spec. There isn't a need to validate how screen readers announce |
Yes, but we should always test any changes made to code.
This isn't a common case like |
@sai6855 Are you in a position to share the results of Tree View interactions with your change using a screen reader? The change you've made is extremely valuable (thanks for doing it!) and it would be great to have the maintainers sign-off on merging it. |
@ZeeshanTamboli Thank you for pushing for this to be manually tested. My apologies for suggesting otherwise. I was just able to manually test @sai6855's PR and found it's not working as expected. With his changes, an indeterminate node is not announced as half-checked: ![]() It looks it's actually the In fact, adding @ZeeshanTamboli: If @sai6855 is able to fix his PR, that'd be great. If he isn't/doesn't, I can submit a new PR, but let me know if the only desired update is to set |
Closes mui/mui-x#18740
found this issue from mui/mui-x#18740