-
Notifications
You must be signed in to change notification settings - Fork 116
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
Combobox Accessibility #3859
Comments
To address the accessibility concerns you've raised with the combobox component:
These steps aim to enhance the combobox component's accessibility, ensuring it provides a consistent and accessible experience for all users. Sources
|
Hi @cogwizzle, I just finished answering another one of your opened issues about Alert Dialogs. Allow me to extend my response there into this thread. Comboboxes are especially complicated UI elements to make accessible. I don't recall why every decision was made the way it was. Instead I ask if you've found your accessibility software to parse the output from our component incorrectly? Making changes based on what the code or markup should look like doesn't always lead to perfectly accessible user interfaces, to my chagrin. I see your keen interest in accessibility and just ask that you provide more information on how this breaks. Thanks! |
I'm just a guy with an inspect button. 😅 So first let's talk about the HTML that is rendered. <div data-paste-element="BOX" data-paste-core-version="20.11.0" role="combobox" aria-haspopup="listbox" aria-owns="downshift-204-menu" aria-expanded="false" class="next-1vxmk41">
<input data-paste-element="COMBOBOX_ELEMENT" data-paste-core-version="20.11.0" readonly="" type="text" id="downshift-204-input" tabindex="0" aria-autocomplete="list" aria-controls="downshift-204-menu" aria-labelledby="downshift-204-label" autocomplete="off" required="" class="next-14y35q4" value="Octavia Butler">
<div data-paste-element="COMBOBOX_CHEVRON_WRAPPER" data-paste-core-version="20.11.0" class="next-pqor4o">
.
<span data-paste-element="ICON" data-paste-core-version="20.11.0" class="next-ggo522">
<svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="ChevronDownIcon-:ra7:"><path fill="currentColor" fill-rule="evenodd" d="M6.293 8.293a1 1 0 011.32-.083l.094.083L10 10.585l2.293-2.292a1 1 0 011.32-.083l.094.083a1 1 0 01.083 1.32l-.083.094-3 3a1 1 0 01-1.32.083l-.094-.083-3-3a1 1 0 010-1.414z"></path></svg>
</span>
</div>
</div> This is the output of the basic Combobox on the documentation pages. As you can see we have Aria's autocomplete list seems to be the right aria property to have if the autocomplete property is enabled on the Combobox react component. My understanding of the "autocomplete" attribute value being off on the real rendered input is referring to the built in browser functionality which is why it is also off with the typeahead version. My concern specifically lies in the fact that the user clicks or tabs to the input in order to focus and blur to toggle the state of the dropdown options. I think it is happening in this file, but here is a picture that shows why I believe this. So based on this behavior when a user with vision impairment selects that element they're going to be conditioned to think autocomplete means I can type when it doesn't mean that all of the time with this component. It might be better if instead of using an input we use a button since you can't actually type in it. Or we change the type from combobox to select when autocomplete is not enabled. Or a mix of all of the above. I should also note that this was a proactive browsing of Paste I made after noticing the spacebar didn't work on the combobox. That is why you're seeing so many issues from me today. There are no reports of this causing an issue, just me noticing it might cause an issue. |
Just dropping a note here, we spoke about this during office hours (for any other readers who swing by). One thing every accessibility engineer will tell you is that you can't always trust "what should be right" to actually be the best user experience. There are many examples of the browser defaults being worse than custom solutions implemented in JS, and more of, what should be, intuitive solutions (such as icon labelling) which do not work properly across all screen reader software. Nothing can replace actual testing on NVDA, Jaws, and VoiceOver. |
Description
When I inspect the HTML of the combobox output I expect to see:
Instead I see:
aria-labeledby
aria attribute that should already be handled by the real label component.Link to Reproduction
https://paste.twilio.design/components/combobox
Steps to reproduce
Paste Core Version
latest
Browser
Google Chrome 123.0.6312.124
Operating System
Additional Information
If we build these non native components that replicate native elements we need to ensure that we make it accessible to how users normally interact with these components.
The text was updated successfully, but these errors were encountered: