[BUG] Problem with accessibility of the CreatableSelect (nested interactive elements) #300
Closed
2 of 6 tasks
Labels
Bug
Something isn't working
Description
This is a problem with
React-Select
as well but, given the fact that this is mostly a UI issue being wrapped inChakra-react-select
it might be looked at.When a
CreatableSelect
contains values (see the "Select with creatable options" from https://codesandbox.io/s/chakra-react-select-ts-demo-vz9ut?file=/app.tsx), each element has a "clear" button (and, is theisClearable
is set, a final "clear" button for remove all values).The wrapping component gets the focus and selected state, which means it is impossible to use the tab key to navigate to every clear button one by one. In essence, the focus is on the "fake" wrapping input field, at the expense of the internal composition.
This is a potential violation of the
nested-interactive
rule (WCAG 2.1 (A)), see https://dequeuniversity.com/rules/axe/html/4.3/nested-interactiveA better solution would be to redesign the wrapper, using the approach
Chakra
uses for the input with an internal button, see https://chakra-ui.com/docs/components/input/usage#password-input-examplechakra-react-select Version
^4.7.6
Link to Reproduction
https://codesandbox.io/s/chakra-react-select-ts-demo-vz9ut?file=/app.tsx
TypeScript?
Steps to reproduce
CreatableSelect
Operating System
Additional Information
From https://codesandbox.io/s/chakra-react-select-ts-demo-vz9ut?file=/app.tsx, showing the wrapper with the focus
ChakraUI input showing
It is worth noting that, at the moment, the tab key is mapped to adding the selected option into the input, not to navigate to another UI elements (unless all options have been cleared). #
I accept that there might be no easy way of combining both patterns
The text was updated successfully, but these errors were encountered: