chore: permissions ux
This commit is contained in:
parent
2e972b3fdc
commit
1b5bf32ce5
4 changed files with 56 additions and 10 deletions
|
|
@ -35,6 +35,22 @@ export function createAutoScroll(options: AutoScrollOptions) {
|
|||
})
|
||||
}
|
||||
|
||||
function forceScrollToBottom() {
|
||||
if (!scrollRef) return
|
||||
|
||||
setStore("userScrolled", false)
|
||||
isAutoScrolling = true
|
||||
if (autoScrollTimeout) clearTimeout(autoScrollTimeout)
|
||||
autoScrollTimeout = setTimeout(() => {
|
||||
isAutoScrolling = false
|
||||
}, 1000)
|
||||
|
||||
scrollRef.scrollTo({
|
||||
top: scrollRef.scrollHeight,
|
||||
behavior: "smooth",
|
||||
})
|
||||
}
|
||||
|
||||
function handleScroll() {
|
||||
if (!scrollRef) return
|
||||
|
||||
|
|
@ -161,6 +177,7 @@ export function createAutoScroll(options: AutoScrollOptions) {
|
|||
handleScroll,
|
||||
handleInteraction,
|
||||
scrollToBottom,
|
||||
forceScrollToBottom,
|
||||
userScrolled: () => store.userScrolled,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue