Skip to content

fix(a11y): make skip link target focusable - #1960

Draft
caugner wants to merge 4 commits into
mainfrom
1726-homepage-skip-link-focus
Draft

caugner wants to merge 4 commits into
mainfrom
1726-homepage-skip-link-focus

Conversation

@caugner

@caugner caugner commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

Make the "Skip to main content" target focusable on every page.

  • Wrap the homepage sections in a main#content landmark, which the homepage was missing.
  • Add tabindex="-1" to all #content targets.
  • Hide the focus outline on #content, since the container is not interactive.
  • Drop a duplicate 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 #content on 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.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
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.
@caugner caugner changed the title fix(homepage): make skip link target focusable fix(a11y): make skip link target focusable Oct 3, 2026

This branch has not been deployed

No deployments
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.

Skip Link: Pressing "Tab" after activating "Skip to main content" returns focus to the top of the page in Firefox

2 participants