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 accessibility controls to 'No results' list item #724

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

owenatgov
Copy link
Contributor

Adds role="option" and aria-disabled="true" to the rendered li when no results have been found. This ensures for screen readers who navigate to the 'no results' li that they know it's still semantically part of the autocomplete interface but not a valid option.

This solution was recommended by DAC following a recent audit of the GOV.UK Design System website.

Resolves alphagov/govuk-design-system#4003

@owenatgov owenatgov requested a review from a team August 12, 2024 16:31
@owenatgov owenatgov force-pushed the no-results-list-item branch from bd31634 to fd59e71 Compare August 21, 2024 14:34
Copy link

netlify bot commented Aug 21, 2024

Deploy Preview for accessible-autocomplete ready!

Name Link
🔨 Latest commit 929c81a
🔍 Latest deploy log https://app.netlify.com/sites/accessible-autocomplete/deploys/66c5fc63b232c8000802c512
😎 Deploy Preview https://deploy-preview-724--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.

Adds `role="option"` and `aria-disabled="true"` to the rendered li when no results have been found. This ensures for screen readers who navigate to the 'no results' li that they know it's still semantically part of the autocomplete interface but not a valid option.

This solution was recommended by DAC following a recent audit of the GOV.UK Design System website.
@owenatgov owenatgov force-pushed the no-results-list-item branch from fd59e71 to 929c81a Compare August 21, 2024 14:40
@owenatgov owenatgov merged commit 3ce7914 into main Aug 21, 2024
7 checks passed
@owenatgov owenatgov deleted the no-results-list-item branch August 21, 2024 14:46
@owenatgov owenatgov mentioned this pull request Sep 12, 2024
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: Use of invalid role when no results found
2 participants