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