fix: Improve scrolling behavior for Conversation Opener (#8437)

Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
Nam Vu 2024-09-14 18:05:19 +07:00 committed by GitHub
parent 72b7f8a949
commit 624331472a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)