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 role=list to lists to fix VoiceOver not announcing as lists #845

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

mcheung-nhs
Copy link
Collaborator

Description

A recent accessibility audit found that when using VoiceOver on a do/don't list, that the list was not announced as a list. Further investgation found that this was a 'feature' of Safari and VoiceOver and that Apple regarded styling a list with list-style-type: none as an indication that the list is no longer a list as you are removing the default visible indication for a list. In our instance, we are restyling the list, so we might still expect it to be announced correctly, as it is with JAWS and NVDA. There is a good explanation of this here: https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html

This issue has also been raised on govuk-frontend - alphagov/govuk-frontend#1471.

The suggested solution of adding role=list is probably the best fix, even if it doesn't seem quite right of adding a list role to a list element, which goes against the first rule of Using Aria.

However in our case I believe this is justified as it could be argued that we are removing the semantics of the list via CSS, so we need to add it back in again via the role atrribute. And the fact that sighted users are seeing a list and JAWS and NVDA announce the list, then it makes sense to add this fix so there is consistent behaviour with VoiceOver.

I've also added the fix to the error summary component. Other components such as the contents list or pagination don't seem to be affected.

I've tested this fix with the following:

  • VoiceOver on Safari 16, macOS Monterey 12.6
  • VoiceOver on Safari on iOS 15.6.1
  • NVDA 2022.3.1 on Firefox 106.0.2 and Chrome 107.0.5304.88
  • JAWS 2021.2111.13 on Microsoft Edge 107.0.1418.24 and Chrome 107.0.5304.88
  • Talkback (Accessibility version 13.5.01.0), Android 12, on Chome 99.0.4844.88

Where the VoiceOvers announce the list correctly, and there is no change with NVDA, JAWS or Talkback.

Checklist

@mcheung-nhs mcheung-nhs merged commit 7011f09 into main Nov 1, 2022
@mcheung-nhs mcheung-nhs deleted the fix/lists-with-no-style branch November 1, 2022 16:40
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.

3 participants