Commit 59017ea
committed
Fix sidebar scroll position when heading nav is involved
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 #29671 parent 6457b38 commit 59017ea
File tree
104 files changed
+339
-5
lines changed- crates/mdbook-html/front-end/templates
- tests/gui
- books/sidebar-scroll
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
104 files changed
+339
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
50 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments