Autocomplete: Combobox missing aria-controls
#4004
Labels
accessibility regulations failure
Does not meet the Public Sector Accessibility Regulations (WCAG 2.2 level AA)
accessibility
audit july 2024
Issues from July 2024 external accessibility audit against WCAG 2.2 criteria
This issue is from the accessibility audit of the Design System website by DAC in July 2024.
DAC's description
The combobox is missing the required
aria-controls
attribute. The lack of thearia-controls
attribute on the combobox can be problematic as it does not associate the relationship between the combobox and its corresponding listbox. Thearia-controls
attribute is fundamental for providing an explicit relationship between these two elements, which is necessary for users who rely on assistive technologies such as screen readers. While there is anaria-owns
attribute present and some user agents might support this, for backwards compatibility it is strongly recommended that thearia-controls
attribute is implemented instead.Current code
DAC's proposed solution
Include the
aria-controls
attribute and ensure that it references the ID of the corresponding listbox. This is to identify the element whose contents or presence are controlled by the current element. Please note that thearia-controls
attribute only needs to be set when the associated listbox is visible.Background information
Our current implementation follows ARIA 1.0 standards, but something was changed in ARIA 1.1.
The Combobox Pattern page from the ARIA Authoring Practices Guide says:
This was raised in alphagov/accessible-autocomplete#565 (and others) before.
Please note Ollie's comments on the issue:
I'd suggest to test an
aria-controls
solution in all major screen readers to evaluate if it doesn't make the experience worse for anyone. Compare it to thearia-owns
solution. And as someone had suggested on issue linked above, it would also be worth testing adding both parameters.Additional instances
This component appears on every page but is a single component, therefore only needs to be fixed once.
It uses the accessible autocomplete component.
Related issues
Needed roles
Frontend developer
The text was updated successfully, but these errors were encountered: