fix(app): stay pinned with auto-scroll on todos/questions/perms
This commit is contained in:
@@ -943,15 +943,12 @@ export default function Page() {
|
|||||||
if (next === dockHeight) return
|
if (next === dockHeight) return
|
||||||
|
|
||||||
const el = scroller
|
const el = scroller
|
||||||
const stick = el ? el.scrollHeight - el.clientHeight - el.scrollTop < 10 : false
|
const delta = next - dockHeight
|
||||||
|
const stick = el ? el.scrollHeight - el.clientHeight - el.scrollTop < 10 + Math.max(0, delta) : false
|
||||||
|
|
||||||
dockHeight = next
|
dockHeight = next
|
||||||
|
|
||||||
if (stick && el) {
|
if (stick) autoScroll.forceScrollToBottom()
|
||||||
requestAnimationFrame(() => {
|
|
||||||
el.scrollTo({ top: el.scrollHeight, behavior: "auto" })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (el) scheduleScrollState(el)
|
if (el) scheduleScrollState(el)
|
||||||
scrollSpy.markDirty()
|
scrollSpy.markDirty()
|
||||||
|
|||||||
Reference in New Issue
Block a user