Skip to content

Commit caf77ad

Browse files
committed
fix(chat): align scrollbar/keyboard detach with wheel/touch re-engage threshold
The onScroll detach branch set only stickyRef.current = false, leaving userDetachedRef false, so a scrollbar-drag or keyboard detach kept the lenient 30px (STICK_THRESHOLD) re-engage threshold instead of the strict 5px (REATTACH_THRESHOLD) used after wheel/touch. A programmatic virtualizer re-pin landing within 30px could then snap autoscroll back on right after the user deliberately scrolled away. Reuse the detach() helper so all detach paths set userDetachedRef consistently.
1 parent e48c960 commit caf77ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/sim/hooks/use-auto-scroll.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export function useAutoScroll(
147147
scrollTop < prevScrollTopRef.current &&
148148
scrollHeight <= prevScrollHeightRef.current
149149
) {
150-
stickyRef.current = false
150+
detach()
151151
}
152152

153153
prevScrollTopRef.current = scrollTop

0 commit comments

Comments
 (0)