Skip to content

Commit

Permalink
fix: Improve scrolling behavior for Conversation Opener (langgenius#8437
Browse files Browse the repository at this point in the history
)

Co-authored-by: crazywoola <[email protected]>
  • Loading branch information
ZuzooVn and crazywoola authored Sep 14, 2024
1 parent 72b7f8a commit 6243314
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/app/components/base/chat/chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ const Chat: FC<ChatProps> = ({
const userScrolledRef = useRef(false)

const handleScrollToBottom = useCallback(() => {
if (chatContainerRef.current && !userScrolledRef.current)
if (chatList.length > 1 && chatContainerRef.current && !userScrolledRef.current)
chatContainerRef.current.scrollTop = chatContainerRef.current.scrollHeight
}, [])
}, [chatList.length])

const handleWindowResize = useCallback(() => {
if (chatContainerRef.current)
Expand Down

0 comments on commit 6243314

Please sign in to comment.