Fix scrolling issue breaking navigation on certain pages.#2104
Closed
bgravenorst wants to merge 3 commits intomainfrom
Closed
Fix scrolling issue breaking navigation on certain pages.#2104bgravenorst wants to merge 3 commits intomainfrom
bgravenorst wants to merge 3 commits intomainfrom
Conversation
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a scrolling issue that broke navigation by removing an unnecessary call to window.scrollTo(0, 0) that was interfering with TOC and anchor link navigation.
- Removed the scroll reset call in the scroll-fix logic to preserve user scroll position.
- Simplified scroll handling logic for better navigation functionality.
Comments suppressed due to low confidence (1)
src/client/scroll-fix.js:12
- Consider adding a comment near this change to clarify that the window.scrollTo(0, 0) call was intentionally removed to prevent overriding user scroll position for TOC and anchor link navigation.
item.scrollIntoView({ block: 'start', inline: 'nearest' })
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Contributor
Author
|
Fixed in #2103 |
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
The right sidebar Table of Contents (TOC) links were not working properly on some pages. When users clicked on TOC links, the page would scroll to the correct section but then immediately jump back to the top, making navigation unusable.
Root Cause
The issue was in
src/client/scroll-fix.jswhere an overly aggressivewindow.scrollTo(0, 0)call was resetting the page scroll position after every route change. This interfered with:Solution
Removed the
window.scrollTo(0, 0)call from the scroll-fix logic while preserving the intended sidebar visibility functionality.Preview
Checklist
Complete this checklist before merging your PR: