Conversation
Contributor
|
b55a6f0 was deployed to: https://fred-pr1960.review.mdn.allizom.net/ |
The "Skip to main content" link points at `#content` on every page, but only the homepage target was made focusable. Without `tabindex="-1"`, activating the link scrolls but does not move focus, so the next Tab restarts from the top of the page.
The wrapping `main` already carries the id, so the nested `article` produced a duplicate id in the document.
`#content` is now focusable via `tabindex="-1"`, so activating the skip link would draw the browser focus ring around the whole page content. The container is not interactive, so the outline adds no information.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Make the "Skip to main content" target focusable on every page.
main#contentlandmark, which the homepage was missing.tabindex="-1"to all#contenttargets.#content, since the container is not interactive.id="content"from the curriculum landing article.Motivation
Give keyboard users a focusable destination when they activate "Skip to main content", so the next Tab continues from the main content instead of restarting at the top of the page.
Additional details
The issue was reported for the homepage, but the skip link points at
#contenton every page and none of the targets was focusable.Without
tabindex="-1", activating the link scrolls to the target but does not move focus, so Firefox restarts sequential focus navigation from the top of the document.Related issues and pull requests
Fixes #1726.