fix: upgrade downshift from 6.1.12 to 7.2.0, a11y fixes for single select and multiselect #252
+132
−117
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.
Supersedes #215
Problem
The single select component is not fully accessible according to the W3C WAI standard for comboboxes. Some bugs in the old implementation included:
->
stepThis PR fixes these issues.
At the same time, I also took the chance to upgrade downshift, which means multiselect also had to be updated. Thus I took the chance to also fix some issues with the multiselect component.
+x more
not center-alignedSolution
Upgrade downshift to 7.2.0. There are two breaking changes:
getComboboxProps
has been removed from the return type ofuseCombobox
as listed here, as a result of the wrapper element not receiving the combobox role attributes. Thus, the props given togetComboboxProps
are passed togetInputProps
instead.At the same time, in some places
aria-hidden
were added and some components moved around in order to fix the other bugs.Additionally, moved menu toggling function to state reducer level since
getToggleButtonProps
are provided to the toggle buttons in both single and multi select.