Repository navigation
Commit aece29f
committed
fix(app): prevent scroll jump during history backfill
Use relative scroll adjustment (scrollTop += delta) instead of
restoring a captured absolute position (scrollTop = beforeTop + delta).
The previous approach captured scrollTop before the DOM update and
restored it inside requestAnimationFrame. During fast scrolling, native
scroll events fire between capture and the rAF callback, making the
captured value stale and causing the viewport to jump.
Keep rAF so async rendering (markdown parsing, syntax highlighting) can
settle before measuring the final scrollHeight. The relative adjustment
reads scrollTop at rAF time, so it stays fresh regardless of user
scrolling in the interim.
Fixes anomalyco#179961 parent d5337b4 commit aece29f
1 file changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
| 135 | + | |
137 | 136 | | |
138 | 137 | | |
139 | | - | |
140 | | - | |
141 | | - | |
| 138 | + | |
| 139 | + | |
142 | 140 | | |
143 | 141 | | |
144 | 142 | | |
| |||
0 commit comments