Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aria-controls to aria props #725

Closed
wants to merge 1 commit into from
Closed

Conversation

owenatgov
Copy link
Contributor

@owenatgov owenatgov commented Aug 14, 2024

What/Why

Adds aria-controls to the list of props in ariaProps.

Previously, we've made the decision to not include aria-controls in favour of aria-owns for better compatability with aria 1.0 and therefore better compatability with screen readers. See Nick's comment and Ollie's comment on this topic.

This has been re-prompted by a DAC audit of the GOV.UK Design System website, where we use the autocomplete for our search. DAC advised the following:

The combobox is missing the required aria-controls attribute. The lack of the aria-controls attribute on the combobox can be problematic as it does not associate the relationship between the combobox and its corresponding listbox. The aria-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 an aria-owns attribute present and some user agents might support this, for backwards compatibility it is strongly recommended that the aria-controls attribute is implemented instead.

Following testing with all current major screen readers on aria-owns, aria-controls and both, we've found no difference between the 3 scenarios. Therefore, we can confidently add aria-controls to our aria props and remove aria-owns.

Resolves alphagov/govuk-design-system#4004
Resolves #565

Notes

The testing isn't complete yet due to difficulties we've been having testing on mobile devices. Based on desktop testing, it's unlikely that anything's going to come out of mobile testing, however for completeness we'll aim to resolve mobile testing before merging.

@owenatgov owenatgov marked this pull request as draft August 15, 2024 10:49
@owenatgov owenatgov marked this pull request as ready for review August 15, 2024 10:49
@owenatgov
Copy link
Contributor Author

I'm going to have to close this and reopen it as a different PR in order to trigger a netlify deploy preview for testing

@owenatgov owenatgov closed this Aug 15, 2024
@owenatgov owenatgov deleted the aria-controls-on-input branch August 16, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autocomplete: Combobox missing aria-controls aria-controls instead of aria-owns?
1 participant