Skip to content

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Dec 11, 2025

This fixes an issue where the sidebar was scrolling incorrectly when clicking on chapters when a heading nav is currently in view. The problem was that it was storing the scrollTop of the sidebar, but it was not considering that when navigating to another chapter that the heading nav of the previous chapter would disappear.

The solution is to keep of an offset instead so that it can make sure that the vertical position of the clicked chapter stays in the same relative position when the new page loads.

Fixes #2967

This fixes an issue where the sidebar was scrolling incorrectly when
clicking on chapters when a heading nav is currently in view. The
problem was that it was storing the scrollTop of the sidebar, but it was
not considering that when navigating to another chapter that the heading
nav of the previous chapter would disappear.

The solution is to keep of an offset instead so that it can make sure
that the vertical position of the clicked chapter stays in the same
relative position when the new page loads.

Fixes rust-lang#2967
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Dec 11, 2025
@ehuss ehuss enabled auto-merge December 11, 2025 19:14
@ehuss ehuss added this pull request to the merge queue Dec 11, 2025
Merged via the queue into rust-lang:master with commit 45e2158 Dec 11, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: waiting on a review label Dec 11, 2025
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.

sidebar-header-nav scrolling issue

2 participants