-
Notifications
You must be signed in to change notification settings - Fork 109
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
Skip to main link adds a focus ring to the H1 #864
Comments
An interesting, related point of difference compared to govuk-frontend is that we place focus on the first h1 in the page whereas govuk-frontend places focus on the main wrapper. They then have a class like this which is added by the JS, to remove the outline:
While ours is hardcoded to the h1, the govuk-frontend one is more flexible and allows skip links that go to other places in the page. We have a couple of pages with more than one skip link on 111 online so this flexibility would be a useful addition. My tendency would be to align ourselves with govuk-frontend here and drop their component in wholesale, but we would need to bottom out why the decision was made to focus the h1 instead of the main element. I had a look through the git history and seems to have always been this way since 2018 (See e58d885). @mcheung-nhs what are your thoughts? Is the h1 behaviour significant, or just an arbitrary difference? |
It feels like it would be good to align to GOV.UK here:
|
We recently had some feedback from screen reader users that after hitting the skip link, they'd expect all the content in main to be announced unless they stopped it. Currently, as the focus jumps to the H1, the H1 is announced and then it stops, none of the other the content is read unless a user manually moves to the next part of the content. The users found it was unexpected and slightly confusing. |
Standard screen reader behaviour after a focus shift is non-continuation of reading. This lets the user decide whether to proceed reading or navigating, i.e. giving the user control. Even if we were able to make the screen reader continue reading having skipped to the main content, this would be non-standard behaviour and could also cause confusion. |
@mcheung-nhs That's interesting and makes sense, thanks for the reply. The feedback we received from a few NVDA users was that they would expect the content to continue reading and that they found it was confusing to land directly on the H1. If you use NVDA or JAWS on a GOV.UK service and skip to main does the content continue to announce for you? I just had a look and another difference with the GOV.UK skip link is when you click 'skip to main' a tabindex="-1" is added to the main tag. Thanks for the help! |
Fixed by #1173 |
We've had a few services in for DAC audits and it's coming back with failures due to the focus ring that's applied around the H1 when a user hits the 'skip to main content' link. DAC auditors are reporting that they only expect focus on interactive elements and find the focus on the h1 to be confusing
It looks like the focus style is added with JS, would it be an easy fix to remove it? Or should the skip to main link just hit main rather than the H1?
The text was updated successfully, but these errors were encountered: