diff --git a/CHANGELOG.md b/CHANGELOG.md index e18162e2b2..56a63dc911 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,14 @@ ([PR #N](https://github.com/alphagov/govuk-frontend/pull/N)) +- Update visually hidden class to fix ordering issue in VoiceOver OSX + + We have fixed an issue in VoiceOver OSX where using the `govuk-visually-hidden` class in links would result in the text being announced out of order. + + We also now recommend to use aria-label or aria-labelledby where appropriate. + + ([PR #1109](https://github.com/alphagov/govuk-frontend/pull/1109)) + ## 2.4.1 (fix release) 🔧 Fixes: diff --git a/src/helpers/_visually-hidden.scss b/src/helpers/_visually-hidden.scss index 519abfb6df..f50895a081 100644 --- a/src/helpers/_visually-hidden.scss +++ b/src/helpers/_visually-hidden.scss @@ -18,7 +18,8 @@ width: 1px iff($important, !important); height: 1px iff($important, !important); - margin: -1px iff($important, !important); + // If margin is set to a negative value it can cause text to be announced in the wrong order in VoiceOver for OSX + margin: 0 iff($important, !important); padding: 0 iff($important, !important); overflow: hidden iff($important, !important); @@ -49,7 +50,8 @@ width: 1px iff($important, !important); height: 1px iff($important, !important); - margin: -1px iff($important, !important); + // If margin is set to a negative value it can cause text to be announced in the wrong order in VoiceOver for OSX + margin: 0 iff($important, !important); overflow: hidden iff($important, !important); clip: rect(0 0 0 0) iff($important, !important);