Skip to content

Commit 0ce61c8

Browse files
committed
fix(app): stay pinned with auto-scroll on todos/questions/perms
1 parent 1ffed2f commit 0ce61c8

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

packages/app/src/pages/session.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -943,15 +943,12 @@ export default function Page() {
943943
if (next === dockHeight) return
944944

945945
const el = scroller
946-
const stick = el ? el.scrollHeight - el.clientHeight - el.scrollTop < 10 : false
946+
const delta = next - dockHeight
947+
const stick = el ? el.scrollHeight - el.clientHeight - el.scrollTop < 10 + Math.max(0, delta) : false
947948

948949
dockHeight = next
949950

950-
if (stick && el) {
951-
requestAnimationFrame(() => {
952-
el.scrollTo({ top: el.scrollHeight, behavior: "auto" })
953-
})
954-
}
951+
if (stick) autoScroll.forceScrollToBottom()
955952

956953
if (el) scheduleScrollState(el)
957954
scrollSpy.markDirty()

0 commit comments

Comments
 (0)