Merge pull request #715 from betgo/bugfix-scrollthumb

fix: autoscroll conflict
This commit is contained in:
Yifei Zhang 2023-04-12 11:05:53 +08:00 committed by GitHub
commit a15bd3ce33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -354,6 +354,7 @@ export function Chat(props: {
const [hitBottom, setHitBottom] = useState(false);
const onChatBodyScroll = (e: HTMLElement) => {
setAutoScroll(false);
const isTouchBottom = e.scrollTop + e.clientHeight >= e.scrollHeight - 20;
setHitBottom(isTouchBottom);
};