Skip to content

Fix TOC scroll event highlighting - #4280

Merged
garrying merged 1 commit into
chainguard-dev:mainfrom
garrying:fix-toc-scrollspy
Oct 21, 2026
Merged

garrying merged 1 commit into
chainguard-dev:mainfrom
garrying:fix-toc-scrollspy

Conversation

@garrying

Copy link
Copy Markdown
Member
  • Fixes the "On this page" highlight, which never worked on pages with heading IDs that start with a digit, such as /get-started/cicd-pipeline/. querySelector("#0-…") threw an error before the scroll listener was attached.
  • Replaces righthand.js and scrollRighthand.js with one module script that sets aria-current on the current link. The CSS styles that attribute, so screen readers get the same state as the highlight.
  • The current section is now the one whose heading is nearest the top of the viewport, ignoring the bottom half, which matches Chrome's native :target-current

@garrying
garrying requested a review from a team as a code owner October 21, 2026 15:10
@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@garrying is attempting to deploy a commit to the Chainguard Team on Vercel.

A member of the Team first needs to authorize it.

@garrying
garrying merged commit 2d30bd5 into chainguard-dev:main Oct 21, 2026
5 of 7 checks passed
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.

2 participants