-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Accessibility: no way to clear the selection with a keyboard #4988
Comments
The mechanism for clearing options currently via the keyboard is backspace. However I agree that having a visible control that cannot be focused by tabbing could be confusing for those who are sighted but cannot use a mouse. |
Yes, whatever keyboard key we choose (space works for me) we need to give it tabIndex. would a PR be accepted for this? |
In other words, sub-components should not be able to be focused by pressing the Tab key. The intended way to clear the selection using a keyboard is by pressing the
You can create a PR which changes the |
@Rall3n I agree to the spec but it’s just sad for the user that it’s a bit confusing. I concede though because following specs allows us to provide a common mental model for users so they can “port” their experiences from one application to another. FYI, your links to the authoring guide above are stale or wrong so I have it here: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/ thank you for the insight. |
On second thought, @Rall3n i just re-read the combo box authoring spec and it refers to the popup button or children of the popup. The clear button is neither of those things. So can you clarify why it would break the spec to make clear tab-able?
|
@dgreene1 I don't believe you should take the absence of these elements from the tab sequence exclusions as meaning they're allowed in the tab sequence. The patterns do not account for a multiselect where selected options are listed outside the listbox. Visually we are showing them as being part of the combobox so I believe @Rall3n is correct in saying they should not be in the tab sequence. |
Hi @Rall3n, any further thoughts on whether the change will be incorporated? |
The problem is that everything that can be done via the mouse should be supported via the keyboard. Delete/backspace only deletes a single item, so there is no equivalent for the clear button. Our company's internal accessibility review has also flagged that fact that the clear button is not keyboard accessible. I disagree with @Rall3n's & agree with @dgreene1's interpretation of the W3C requirements. It is true that the requirements say "The popup indicator icon or button (if present), the popup, and the popup descendants are excluded from the page Tab sequence.", but the clear button is not the popup indicator/button nor is it a popup descendant. The W3C requirements do not include any mention of the clear button, so we can choose to treat it however we want (as long as it is keyboard accessible). Even if we want to exclude the clear button from the page Tab sequence, we can still make the clear button accessible to keyboard users. This can be achieved by having it accessible via the L/R arrow keys while the tab focus is on the combobox (similar to the behavior of the navigating between the clear buttons of the individually selected items in the multi-select case). |
Hi just found this control and its pretty nice, however keyboard navigation for delete and marking etc are really basic for instance I use shift-home and then delete a lot, to quickly mark a line current line when I am typing and I change my mind. Use case search for a user in a multiselect by name, then decide you want another one, then you do shift-home delete, and start typing again.. Now I need to backspace x times to delete all the characters. I didn't realise how often I use shift-home, delete until it wasn't there in this widget. |
Any update on this? |
I'm looking into fixing this |
@mattotx Perhaps you can make the clear button being keyboard-accessible opt-in behavior. |
@mattotx Any update on the fix? |
Just to make sure it doesn't get lost in a PR (#5850) that will likely get closed, I wanted to share what was discussed there that is relevant to this topic. @jossmac found the WCAG spec that addresses keyboard interaction expectations for combobox controls (which is what react-select is):
As far as what is currently implemented at this time in react-select:
With regard to clearing react-select instances, it's my belief that react-select MUST be updated to support the clearing of input when Hope this helps. |
Caveat: I'm not an accessibility expert so perhaps there is an alternative mechanism available to clear selections. But the usual way (tabbing to the clear button) is not working.
Reproduction Steps
Expected Behavior
I would expect Step 4 to focus the "X" that clears the selected option.
Actual Behavior
You can't focus the clear button.
Proposed Solution
Make the clear
div
abutton
tag.Am I Willing To Submit A PR For This?
Yes, absolutely. The company I work for has budget for fixing a11y issues in the open source libraries we use or that we are considering using.
The text was updated successfully, but these errors were encountered: