diff --git a/src/client/scripts/sticky-sidebar.ts b/src/client/scripts/sticky-sidebar.ts index 1a9ab61ac..9d46a7831 100644 --- a/src/client/scripts/sticky-sidebar.ts +++ b/src/client/scripts/sticky-sidebar.ts @@ -22,7 +22,7 @@ export class StickySidebar { if (this.isTop) { this.isTop = false; - this.spacer.style.marginTop = `${scrollTop}px`; + this.spacer.style.marginTop = `${this.lastScrollTop}px`; } } else { // upscroll const overflow = this.el.clientHeight - window.innerHeight;