Browse Source

chore: cleanup

Adam 1 month ago
parent
commit
70c6fcfbbf
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/ui/src/hooks/create-auto-scroll.tsx

+ 3 - 1
packages/ui/src/hooks/create-auto-scroll.tsx

@@ -78,11 +78,13 @@ export function createAutoScroll(options: AutoScrollOptions) {
 
   const scrollToBottom = (force: boolean) => {
     if (!force && !active()) return
+
+    if (force && store.userScrolled) setStore("userScrolled", false)
+
     const el = scroll
     if (!el) return
 
     if (!force && store.userScrolled) return
-    if (force && store.userScrolled) setStore("userScrolled", false)
 
     const distance = distanceFromBottom(el)
     if (distance < 2) {