fix: regenerate scroll bottom (#4348)
This commit is contained in:
parent
c77275a35c
commit
c0f3fb5007
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user