fix(app): stay pinned with auto-scroll on todos/questions/perms
This commit is contained in:
parent
1ffed2fa6c
commit
0ce61c817b
1 changed files with 3 additions and 6 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue