Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/nodejs-website Please review the changes when you have a chance. Thank you! 🙏 |
ubay1
force-pushed
the
fix/sidebar-scroll-to-active-item
branch
from
November 12, 2026 13:57
cf5514a to
87d5232
Compare
…pper doc-kit targets `is-land[data-island-name='SideBar']` while this repo registers the island as `Sidebar`, leaving it with `display: contents` and breaking sticky/overflow scrolling on the sidebar.
This branch was successfully 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.
Every navigation on https://nodejs.org/learn
is a full page load, so the sidebar always resets to the top. When you click an item near the bottom of the sidebar (e.g. Diagnostics or TypeScript), the page you just opened is no longer visible in the navigation, and you have to scroll back down to find where you are.
This PR scrolls the sidebar so the active item is centered when the page loads.
Earlier ideas were discussed and turned down:
This approach needs no storage and no navigation changes. The active item is derived from the current pathname, which the sidebar already knows. The whole change is limited to components/Sidebar/index.jsx.
Changes
components/Sidebar/index.jsx: adds a useLayoutEffect that:
Validation