Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use accessible autocomplete instead of select_with_search
Following an accessibility audit, the select_with_search component was found not to meet WCAG requirements - "Users should be able to access this list using a keyboard or other input methods, with each item being announced along with a count of the total number of options." It seems like on Safari Voice Over would not read out the selected option at all, and in other browsers would not read out the total count of options. I'm replacing the component with the autocomplete component, which does not use the `Choices` library and is based on the alphagov accessible autocomplete, and seems to provide the same functionality and the required Voice Over behaviour. There are accessibility issues when using this component with the `multiselect` option (as Whitehall do)[1], but shouldn't be when just using it as a combobox. I've also had to change one of our feature specs, because using the javascript helpers changes how the `select` function works (it's designed for the Choices library). We don't actually need to fill in the form so I've just removed that step. [1] https://drive.google.com/file/d/1BgR9Tkpr9nEYoU3mrUwue306XjLAsZ7B/view?usp=sharing (when the selected options appear below the combobox they are not announced, and not keyboard navigable)
- Loading branch information