[MDCT-2042]: Make dropdown checkbox options accessible #139439
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The default behavior of a third-party library (react-multi-select-component) was disallowing tabbing through dropdown checkbox options. The solution was to utilize the component's exposed
ItemRenderer
prop to provide a custom component to render for each dropdown option. In this case, the component to be provided is the exact same as the default component but one major change: it does not settabIndex={-1}
, which allows users to tab to the dropdown checkbox options. Really this just involved:tabIndex
propertyHere's a video of it in action:
clip.mov
Related ticket(s)
MDCT-2042
How to test
m2042-a11yed-droppies
and run locallyTab
, select/unselect options withSpace
, unselect dropdowns withEsc
, etc.Important updates
Author checklist
I have added thorough tests, if necessaryI have updated relevant documentation, if necessaryconvert to a different template: test → val | val → prod