Skip to content

sidebar-header-nav scrolling issue #2967

@weihanglo

Description

@weihanglo

Problem

When the current chapter item in the sidebar went out of the window, if you navigated to another chapter, mdbook computed the scroll-to position wrong, and scrolled to a wrong place.

The recording below shows that

  1. Fine if the the current chapter with is within the window
  2. Not fine if it is out of sight.
Screen.Recording.2025-11-28.at.14.09.34.mov

Steps

  1. Find a long enough chapter having a lots of headings.
  2. Follow what the recording did.

Possible Solution(s)

No response

Notes

No response

Version

https://crates.io/crates/mdbook/0.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: A bug, incorrect or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions