mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-09 03:26:38 +08:00
Improve the logic for scrolling to the bottom
Remove unnecessary 20px offset, because `scrollHeight = clientHeight + scrollTop` Fix: #905
This commit is contained in:
parent
e68f17b463
commit
e554de7a12
@ -434,7 +434,7 @@ export function Chat(props: {
|
||||
const [hitBottom, setHitBottom] = useState(false);
|
||||
|
||||
const onChatBodyScroll = (e: HTMLElement) => {
|
||||
const isTouchBottom = e.scrollTop + e.clientHeight >= e.scrollHeight - 20;
|
||||
const isTouchBottom = e.scrollTop + e.clientHeight >= e.scrollHeight;
|
||||
setHitBottom(isTouchBottom);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user