-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[a11y]: Dropdown MultiSelect button should have role="combobox" instead of button #12596
Comments
I don't think we'd be able to change the role to That said, I can confirm the issue in the v11 storybook. @mbgower I'm not sure how we might approach this one. Do you have any thoughts? At first glance I'm wondering if this might be a false positive. |
I'm pulling @tombrunet in on this. Too technical for me. My hunch is that you need to make the tag a peer of the listbox. If it is at the same level, it shouldn't spit out this error. But that's ill-informed conjecture :) |
@tw15egan I think there are some problems with that approach, on investigation. I just met with Tom and went through these different components, and we have suggestions across the board on the whole 'dropdown' family. Tom is going to summarize some of those here, but I'm also sending you a small video we just made. |
The high level issue is that most widgets aren't intended to be containers (other than maybe grid). If a widget has content (like button), that content is typically just a shorthand for the aria-label. So the question is, how do you handle these widgets that have multiple mouse actions associated with them? The net is, the multiple mouse actions are a mouse accommodation for the fact that the mouse is limited on what it can do on the widget - focus or activate mostly. A keyboard doesn't have that limitation, so it doesn't necessarily need all of those other visual buttons to perform actions. For a combobox / dropdown, typically, the escape key is used to clear while on the combobox (no need to tab off to perform the action). A good reference for this is the APG guide for combobox: Some basic rules of thumb:
|
Okay, that makes sense. I've adjusted the PR for now to include the following:
Just pushed up some changes to the same PR, deploy preview should be updated in a few minutes https://deploy-preview-13173--carbon-components-react.netlify.app/ |
@mbgower just pushed some updates that should address these issues 👍🏻 |
You work fast, my friend :) |
Say, while doing so, and comparing interaction across all these things I noticed that pressing Enter was NOT opening the filtering multiselect listbox when it had focus. I thought it should, so went and looked at the others just to make sure everything was consistent. While doing so, noticed a couple of other things (sorry!):
|
PS, in the time it took me to start that, have a couple of meetings, and update it and post the comment, I see you've partially addressed my prior comment on interaction curiosities. Now, I'd like Tom to weigh in on the behaviour I'm now seeing on the filterable mutliselect, which is that if I've entered in a filter string and am arrowing through the filtered items that match, when I press Esc, the list collapses AND the string is cleared (leaving me just with the 2x or whatever label showing how many are selected). I think that works, and I also think it makes an interesting comparison with the action we got you to do on the combo box (pressing Esc once only collapse, not clears string). @tombrunet would you please play with it and give your two bits? Obviously for consistency, it would make more sense to just collapse the list, like the combo box. I'm just having troubles imagining why we need that intermediary step in the filterable multiselect. Unlike the combo box, there is no case for the string to stick around as a potential new value. I can add to or alter the string without the need to collapse the list. So to me, if someone collapses this variant, ditching the string almost seems like an intentional feature? |
Package
carbon-components-react
Browser
Chrome
Operating System
Windows
Package version
7.59.3 (from @console/pal)
React version
17.0.2
Automated testing tool and ruleset
IBM Equal Access Accessibility Checker - latest version
Assistive technology
No response
Description
The buttons inside the MultiSelect causes issue because parent is a
button
instead of arole="combobox"
WCAG 2.1 Violation
IBM 4.1.2 Name, Role, Value
Reproduction/example
https://v10.carbondesignsystem.com/components/dropdown/code
Steps to reproduce
Code of Conduct
The text was updated successfully, but these errors were encountered: