Skip to content

[docs-infra] Move focus to the main content with the skip link - #48944

Open
lazerg wants to merge 1 commit into
mui:masterfrom
lazerg:fix/issue-48943-skip-link-focus
Open

[docs-infra] Move focus to the main content with the skip link#48944
lazerg wants to merge 1 commit into
mui:masterfrom
lazerg:fix/issue-48943-skip-link-focus

Conversation

@lazerg

@lazerg lazerg commented Aug 11, 2026

Copy link
Copy Markdown

Fixes #48943

Activating "Skip to content" scrolled the page but left DOM focus where it was, so the next Tab went back through the announcement bar and the header. MarkdownLinks registers a document-level click handler that calls preventDefault() on every internal anchor and hands the URL to Router.push, and the skip link goes through it as well, so the browser never runs its own fragment navigation.

Opting the link out with data-no-markdown-link brings that back, and #main-content now carries tabIndex={-1} so it can receive focus.

Validation:

  • pnpm test:e2e-website:dev -g "skip link", which fails on master and passes here
  • pnpm eslint, pnpm typescript and pnpm prettier --check on the touched files

@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-48944--material-ui.netlify.app/
QR code for https://deploy-preview-48944--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

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.

[docs] Skip link scrolls viewport but fails to shift programmatic focus to main content

1 participant