-
Notifications
You must be signed in to change notification settings - Fork 191
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
[Bug][a11y]: mixed-value state of swatches must be conveyed to screen readers using ARIA #3298
Comments
Do we only want this for the |
Only mixed-value. nothing means no color or transparent. And i think that should be communicated by the label for all swatches using 'nothing'. That said, i have a question about labelling these swatches. Documentation doesn't have labels for these swatches even though the api allows label attribute. Does it make sense to use |
Good question. I think what's become clear through this audit, as well as comments we've had in the past from other consumers, is that our |
PR fix: #3330 |
I was looking at Rajdeep's PR, and I have some questions about fixing the issue: Swatch currently has the role of "button" by default, not checkbox, so it will only denote I did see you added #3320 so perhaps adding this kind of label will clarify some things in the screen reader. @Rajdeepc, let's chat tomorrow about adding this functionality. |
I think the intent of the mixed state should be made clear in the documentation as well. That the mixed state is meaningful with a swatchgroup that has selection="multiple". And as you said, if they're using it in other scenarios then the burden is on them to use appropriate labels to convey what they're trying to do. |
PR is merged and waiting for testing. |
@dineshy87 Can you please verify this from your end and let us know? |
@dineshy87 Awaiting your confirmation on this. Thank you |
@najikahalsema Let me know your thoughts on the above issue raised by Dinesh during testing. Should we track this here or on another issue? |
I think I'm confused now 😅 My understanding was that that |
Let me clarify a little bit more. The problem will persist as long as the swatches have role="button" on them when selects="multiple" is used. My recommendation is to render individual swatches in swatch-group with selects="multiple" as checkboxes instead of buttons. Only then, aria-checked="mixed" will make sense. |
Do they not convert to checkbox state when selects = multiple? I believe what you suggest is already in the code. |
Oops sorry. It seems that they do. However, the screenshot i shared above is from documentation for swatch which has examples for mixed state that need to be updated. Because they're being used in places other than where selects="multiple" is used. And if you run Axe on the below page, you'll find those errors. https://opensource.adobe.com/spectrum-web-components/components/swatch/ I'd recommend the example be corrected to use selects='multiple'. |
@najikahalsema PR for the changes requested above. |
Follow up issue tracking here: #3458 |
Code of conduct
Impacted component(s)
sp-swatch
Expected behavior
Currently, mixed state is not conveyed to screen reader users. Please use aria-checked="mixed" when mixed-value is used.
Please also note that mixed value is supported by only certain tri-state inputs such as a checkbox or menuitemcheckbox.
The mixed value is not supported on radio or menuitemradio
Actual behavior
mixed-value is not communicated to screen reader users
The text was updated successfully, but these errors were encountered: