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 element with id "Top" to receive focus from "Top of page" links #3076

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

davidtrussler
Copy link
Contributor

Trello

This deals with a widespread use of a <a href=“#Top”> link within page content which visually returns the user to the top of the page. However, since there is no element with that ID on the page, focus remains on the link so keyboard-only and screen-reader users are unable to navigate from that point.

This change adds a <span> element with that ID so that focus is added to the top of the content and these users can continue to navigate the page.

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3076 February 5, 2024 12:55 Inactive
@andysellick
Copy link
Contributor

Is this a problem with content containing links to #top in govspeak? Seems a shame to have to add an empty element to fix this.

@davidtrussler
Copy link
Contributor Author

Is this a problem with content containing links to #top in govspeak? Seems a shame to have to add an empty element to fix this.

Yes it is. And yes it does. The problem is the huge number of instances of this that currently exist. We have discussed longer term solutions as well but since it's a current accessibility failure we need to get something in place to cover that.

@davidtrussler davidtrussler merged commit e7651b3 into main Feb 6, 2024
13 checks passed
@davidtrussler davidtrussler deleted the 2365_Top-element-added-to-receive-focus branch February 6, 2024 16:18
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.

4 participants