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 #727

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Add aria-controls to aria props #727

merged 1 commit into from
Aug 16, 2024

Conversation

owenatgov
Copy link
Contributor

@owenatgov owenatgov commented Aug 15, 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

Voiceover on desktop and iOS don't seem to recognise the contents of the input whilst in the combobox. This was true before changing the aria prop so this isn't a regresion, but something to be concious of.

Copy link

netlify bot commented Aug 15, 2024

Deploy Preview for accessible-autocomplete ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/accessible-autocomplete/deploys/66bddf504026b2008c183116
😎 Deploy Preview https://deploy-preview-727--accessible-autocomplete.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@owenatgov owenatgov marked this pull request as ready for review August 15, 2024 14:33
@owenatgov owenatgov requested a review from a team August 16, 2024 14:08
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?
2 participants