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

Investigate visually hidden text bug in OSX VoiceOver #1096

Closed
NickColley opened this issue Dec 17, 2018 · 8 comments · Fixed by #1109
Closed

Investigate visually hidden text bug in OSX VoiceOver #1096

NickColley opened this issue Dec 17, 2018 · 8 comments · Fixed by #1109

Comments

@NickColley
Copy link
Contributor

NickColley commented Dec 17, 2018

We've had a report from @stevenaproctor that using visually hidden text results in bugs in VoiceOver.

#958 (comment)

We should try and reproduce this, I suspect it may be someone testing VoiceOver in Chrome rather than Safari, but since this is a very widespread pattern on GOV.UK (and GOV.UK Frontend) it's worth an investigation.

@stevenaproctor
Copy link

@NickColley I got this from our accessibility lead so I doubt it is because they used Chrome.

@NickColley
Copy link
Contributor Author

NickColley commented Dec 18, 2018

This seems to only be a problem with links:

https://jsbin.com/gocabamowi/1

https://output.jsbin.com/gocabamowi/1

🔴Mac OSX High Sierra v10.13.3 (17D47), Safari Version 11.0.3 (13604.5.6):

  • Buttons reads "Change name"
  • links read out "name Change"

🔴iOS 12.0.1 VoiceOver

  • Button reads "Change name"
  • Link reads "Change"

JAWS 17: "Change name" for both
NVDA 2018: "Change name" for both

@NickColley
Copy link
Contributor Author

NickColley commented Dec 18, 2018

This might be related:

https://github.com/h5bp/html5-boilerplate/issues/1985

I have updated my example with their suggestion for the visually hidden class and will test again:

https://jsbin.com/qozumosiji/edit?html,css,output

https://output.jsbin.com/qozumosiji

🍏 Mac OSX High Sierra v10.13.3 (17D47), Safari Version 11.0.3 (13604.5.6):

  • Buttons reads "Change name"
  • links read out "Change name"

🔴 iOS 12.0.1 VoiceOver

  • Button reads "Change name"
  • Link reads "Change"

@hannalaakso
Copy link
Member

I tested this with Mac Voiceover on Safari 11.1 (OSX 10.11.6) and it reads out "Change name, link" on the link. So it seems that this could be a recent regression with OSX.

@NickColley
Copy link
Contributor Author

I have investigated this and recorded the results in this gist: https://gist.github.com/nickcolley/19b80ed24d0364cfd3afd3b1b49c4014

Conclusion

We should update the govuk-visually-hidden class to remove the negative margin which will fix the ordering issue in VoiceOver for OSX.

We should recommend using aria-label or aria-labelledby where it makes sense to.

Visually hidden CSS can result in text not being read out when touching on iOS, this is regrettable but does not cause a hard barrier as users can explore the surrounding content to understand context.

@stevenaproctor I found that the duplicate approach works pretty well but in VoiceOver iOS it makes the virtual focus area render oddly

@stevenaproctor
Copy link

@NickColley Thanks for taking a look. I assume aria-label or aria-labelledby does not cause any of the issues.

@NickColley
Copy link
Contributor Author

NickColley commented Jan 7, 2019

@stevenaproctor yes they're both good options in the right scenarios, there are certain instances where it's impractical to use those so you'll still want to use the visually hidden class.

They're both also future friendly, there is a risk that this CSS will cause issues in a future rendering engine, and it's difficult to update very old services. Whereas aria-label is intended for this purpose and should stand the test of time.

We might want to consider having some guidance on how to do this in the future.

@stevenaproctor
Copy link

@NickColley I think guidance on which method to use in what situation will be good and essential. Maybe a new entry in 'Typography'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants