From c0f3fb50070cc384477520b7077169548963cd1a Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Sun, 29 Dec 2024 21:58:46 +0800 Subject: [PATCH] fix: regenerate scroll bottom (#4348) --- web/screens/Thread/ThreadCenterPanel/ChatBody/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/screens/Thread/ThreadCenterPanel/ChatBody/index.tsx b/web/screens/Thread/ThreadCenterPanel/ChatBody/index.tsx index f384611c5..e05d36afb 100644 --- a/web/screens/Thread/ThreadCenterPanel/ChatBody/index.tsx +++ b/web/screens/Thread/ThreadCenterPanel/ChatBody/index.tsx @@ -86,6 +86,7 @@ const ChatBody = memo( }) useEffect(() => { + isUserManuallyScrollingUp.current = false if (parentRef.current) { parentRef.current.scrollTo({ top: parentRef.current.scrollHeight }) virtualizer.scrollToIndex(count - 1) @@ -93,6 +94,7 @@ const ChatBody = memo( }, [count, virtualizer]) useEffect(() => { + isUserManuallyScrollingUp.current = false if (parentRef.current && isGeneratingResponse) { parentRef.current.scrollTo({ top: parentRef.current.scrollHeight }) virtualizer.scrollToIndex(count - 1) @@ -100,6 +102,7 @@ const ChatBody = memo( }, [count, virtualizer, isGeneratingResponse]) useEffect(() => { + isUserManuallyScrollingUp.current = false if (parentRef.current && isGeneratingResponse) { parentRef.current.scrollTo({ top: parentRef.current.scrollHeight }) virtualizer.scrollToIndex(count - 1)