-
Notifications
You must be signed in to change notification settings - Fork 333
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
Summary list action links visually hidden text are read out without spaces in screen readers #1643
Comments
We might want to also report this as an issue to the assistive technology vendors as it seems that the accessibility tree has the correct content. |
Next steps:
|
Most probably related: #1032 and alphagov/reported-bugs#39. |
Good call @selfthinker – although we fixed this in the wider 'visually-hidden' class by adding govuk-frontend/src/govuk/components/summary-list/_summary-list.scss Lines 59 to 64 in 82811f3
I wonder if the same approach might fix it (applying |
I've tested this in a few screen reader combinations and recorded the results in a spreadsheet: https://docs.google.com/spreadsheets/d/1Q-jTC8bcBagPHLlhyxH81FSqlNL446kyMU04st9PJxE/edit?usp=sharing Will update with thoughts later. |
It seems adding an extra spacing does 'work' but in some assistive technologies now there is double spacing which could impact pronunciation too. One thing that's interesting to me is that the accessibility trees are correct but then the screenreader can read something different to the tree, which means either:
It's hard to know if it's the latter without real user feedback, we could consider messaging the original issue raiser to ask them if they ran into this from being confused or from a testing perspective. Through doing it I did wonder if there was a way to tweak the CSS itself to see if that's the issue, but this is one of those really gnarly ones that also takes a really long testing. |
Things we could do to go forwards with this issue:
|
Had a chat with Ollie. We're going to try to make reduced test cases to raise bugs with the assistive technology vendors as the accessibility tree is correct, this process may also help us learn more about the underlying issues and also the vendors themselves may be able to give us advice if they've seen this sort of issue before. |
Test case: https://output.jsbin.com/jorocat <a href="#">Link in page</a>
<br>
<button>
Open all<span class="visually-hidden"> sections</span>
</button>
<br>
<a href="#">
Delete<span class="visually-hidden"> name</span>
</a> .visually-hidden {
position: absolute !important;
width: 1px !important;
height: 1px !important;
margin: 0 !important;
padding: 0 !important;
overflow: hidden !important;
clip: rect(0 0 0 0) !important;
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
border: 0 !important;
white-space: nowrap !important;
} |
Closing this out as raised issues, hopefully they get resolved! We can re-open if this becomes a more serious issue for our users. We should also consider using aria-label where appropriate going forwards. |
This could be fixed by providing two seperate blocks of content rather than concatenating them, such as this:
The only downside of this is duplication of content if CSS is disabled, but that can be fixed by adding a hidden attribute to the first span which is overridden with CSS when available. |
There are some other issues with the current implementation Voiceover iOSIn Voiceover on iOS the span in the middle of the accessible name means that if a user is navigating by links they hear:
Android TalkBackWith Android TalkBack when a user is navigating normally by swiping the effect is the same as with VO navigating by links as in there are multiple navigations needed to move through a link |
We've had this issue reported in an accessibility audit, though I don't know for what AT combinations. |
Digital Accessibility Centre (DAC) raised this issue in a recent audit for a New Style Employment and Support Allowance. I can share the full report if useful. |
Hi @ladine-cook, thank you for letting us know this issue has been raised by DAC. If you are able to share the full report with is that would be amazing, we would especially like to know which browser/assistive tech combination this issue was found in (including versions). |
Thanks for sending that over @ladine-cook, that was very useful. It looks like again they were seeing this issue with JAWS (versions 18 and 19), although I'm not sure whether it was with Firefox or IE11. I can reproduce the issue using the check your answers pattern example in AssistivLabs with JAWS 2021.2103.174 and Firefox or Chrome, but not with JAWS and IE11. It's a bit of a shame that nothing has moved on the issue we raised with JAWS FreedomScientific/standards-support#372, I've leave a message on the issue to see if we can't get this fixed upstream. |
On the GOV.UK search results page, the h1 heading contains the word "Search" and the visually hidden text, "all content" which should be available to screen reader users. However, JAWS and NVDA on Chrome, Edge and IE11 are not announcing the space before "all content". This came up in user research, with the user saying that it was challenging the identify what was being announced with the space omitted. This is also a known issue which has previously been reported to JAWS: alphagov/reported-bugs#51 I found out in my investigation that in fact there is a rationale to how JAWS and NVDA omit the space: the `govuk-visually-hidden` class uses `position: absolute` as a fallback for older browsers that don't support `clip-path` for hiding content. When the visually hidden element is taken out of the page flow like this, the space before the text gets removed as it's no longer relative to the text preceeding as is expected of absolute positioning. This can be seen both visually in modern browsers when `clip-path` is removed, and by inspecting the accessibility tree: with `position: absolute`, the value of the visually hidden content in the accessibility tree is "all content" (without the space), and without it it's " all content". So in fact JAWS and NVDA are announcing the heading correctly in the sense that the space has been removed, but it's not desirable behaviour. Use `opacity: 0` instead of the `govuk-visually-hidden` to visually hide the content - this tests well in all screen readers and browsers, with the text visually hidden but accessible to assistive technologies. Make it into an app specific class for now. We can add it to the gem sometime later by using the search results heading as evidence that it works for users with no issues reported. We could then also consider contributing it to the GOV.UK Design System as a fix for the long standing issue there (I haven't focused on testing the visually hidden headings used in the Check your answers pattern but I've got the impression that `govuk-visually-hidden` works slightly better inside interactive elements like the links in that pattern). An alternative fix would have been to replicate the styles of `govuk-visually-hidden` in this new app class and just replacie `position: absolute` with `opacity: 0;`. This also tested well and would be a slightly safer option in the sense that all the functionality of the existing visually hidden class would be retained, apart from the legacy fallback of `position: absolute`. However if we adopted `opacity: 0` as the new way of visually hiding content there wouldn't seem to be any need for retaining the existing `govuk-visually-hidden` styles, so it seems to make sense to just launch `opacity: 0` on its own since this is only one instance to start with and there is a very low risk of introducing any serious bug as a result (the worst would be that the visually hidden text is either visible or not). Yet another alternative, also [explored on the original ticket](alphagov/govuk-frontend#1643 (comment)) would be to use a non-breaking space ` `. This also tested well, but this wouldn't fix the underlying problem but would be more of a manual fix which might also get removed by mistake by the next person working on the piece of code.
On the GOV.UK search results page, the h1 heading contains the word "Search" and the visually hidden text, "all content" which should be available to screen reader users. However, JAWS and NVDA on Chrome, Edge and IE11 are not announcing the space before "all content". This came up in user research, with the user saying that it was challenging the identify what was being announced with the space omitted. This is also a known issue which has previously been reported to JAWS: alphagov/reported-bugs#51 I found out in my investigation that in fact there is a rationale to how JAWS and NVDA omit the space: the `govuk-visually-hidden` class uses `position: absolute` as a fallback for older browsers that don't support `clip-path` for hiding content. When the visually hidden element is taken out of the page flow like this, the space before the text gets removed as it's no longer relative to the text preceeding as is expected of absolute positioning. This can be seen both visually in modern browsers when `clip-path` is removed, and by inspecting the accessibility tree: with `position: absolute`, the value of the visually hidden content in the accessibility tree is "all content" (without the space), and without it it's " all content". So in fact JAWS and NVDA are announcing the heading correctly in the sense that the space has been removed, but it's not desirable behaviour. Use `opacity: 0` instead of the `govuk-visually-hidden` to visually hide the content - this tests well in all screen readers and browsers, with the text visually hidden but accessible to assistive technologies. Make it into an app specific class for now. We can add it to the gem sometime later by using the search results heading as evidence that it works for users with no issues reported. We could then also consider contributing it to the GOV.UK Design System as a fix for the long standing issue there (I haven't focused on testing the visually hidden headings used in the Check your answers pattern but I've got the impression that `govuk-visually-hidden` works slightly better inside interactive elements like the links in that pattern). An alternative fix would have been to replicate the styles of `govuk-visually-hidden` in this new app class and just replacie `position: absolute` with `opacity: 0;`. This also tested well and would be a slightly safer option in the sense that all the functionality of the existing visually hidden class would be retained, apart from the legacy fallback of `position: absolute`. However if we adopted `opacity: 0` as the new way of visually hiding content there wouldn't seem to be any need for retaining the existing `govuk-visually-hidden` styles, so it seems to make sense to just launch `opacity: 0` on its own since this is only one instance to start with and there is a very low risk of introducing any serious bug as a result (the worst would be that the visually hidden text is either visible or not). Yet another alternative, also [explored on the original ticket](alphagov/govuk-frontend#1643 (comment)) would be to use a non-breaking space ` `. This also tested well, but this wouldn't fix the underlying problem but would be more of a manual fix which might also get removed by mistake by the next person working on the piece of code.
What
This is a report from a screen reader user:
I believe that I missed this as audibly it sounds correct to me, but I imagine depending on how you have your screen reader configured, for example how fast you have words announced, it could make it hard to understand.
I've managed to reproduce this issue in NVDA + Firefox and used the 'speech viewer' tool to see what the user has found.
The user has also let us know that the following combinations have the same issue, which suggests that it's an issue with most screen readers:
Recommend that we consider testing with tools like 'speech viewer' in the future to help catch issues like this.
I tried a quick fix by adding
instead of a space character, and that seemed to resolve this issue, but we'd want to test this across screen readers.I will also raise an issue in the design system website for the related issues there.
Who needs to know about this
Developers
The text was updated successfully, but these errors were encountered: