mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 07:36:39 +08:00
滚动动画bug修复,及丝滑一点
This commit is contained in:
parent
909834d4b4
commit
bf457c6853
@ -438,14 +438,23 @@ function useScrollToBottom(
|
||||
if (dom) {
|
||||
requestAnimationFrame(() => {
|
||||
setAutoScroll(true);
|
||||
dom.scrollTo(0, dom.scrollHeight);
|
||||
// dom.scrollTo(0, dom.scrollHeight);
|
||||
// 丝滑一点
|
||||
dom.scrollTo({
|
||||
top: dom.scrollHeight,
|
||||
behavior: "smooth",
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// auto scroll
|
||||
useEffect(() => {
|
||||
if (autoScroll && !detach) {
|
||||
// if (autoScroll && !detach) {
|
||||
// scrollDomToBottom();
|
||||
// }
|
||||
// 自动滚动一直有bug,直接强制修改了
|
||||
if (autoScroll) {
|
||||
scrollDomToBottom();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user