fix: adjust scroll detection threshold in chat component (#14640)

This commit is contained in:
Kalo Chin 2025-03-06 23:36:59 +09:00 committed by GitHub
parent 9437a1a844
commit b7583e95a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -186,7 +186,7 @@ const Chat: FC<ChatProps> = ({
if (chatContainer) {
const setUserScrolled = () => {
if (chatContainer)
userScrolledRef.current = chatContainer.scrollHeight - chatContainer.scrollTop >= chatContainer.clientHeight + 300
userScrolledRef.current = chatContainer.scrollHeight - chatContainer.scrollTop > chatContainer.clientHeight
}
chatContainer.addEventListener('scroll', setUserScrolled)
return () => chatContainer.removeEventListener('scroll', setUserScrolled)