Skip to content

Commit cddb13b

Browse files
authored
Merge pull request #459 from iceljc/main
fix chat scrolling
2 parents d64bc5f + d4138db commit cddb13b

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/routes/chat/[agentId]/[conversationId]/chat-box.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,9 @@
464464
requestAnimationFrame(() => {
465465
scrollbars.forEach(scrollbar => {
466466
if (!scrollbar) return;
467-
scrollbar.scrollTo({ top: scrollbar.scrollHeight, behavior: 'smooth' });
467+
setTimeout(() => {
468+
scrollbar.scrollTo({ top: scrollbar.scrollHeight, behavior: 'smooth' });
469+
}, 150);
468470
});
469471
_autoScrollScheduled = false;
470472
});

src/routes/chat/[agentId]/[conversationId]/rich-content/rc-message.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@
6767
requestAnimationFrame(() => {
6868
const el = thinkingContentEl;
6969
if (el) {
70-
el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' });
70+
setTimeout(() => {
71+
el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' });
72+
}, 150);
7173
}
7274
_thinkingScrollScheduled = false;
7375
});

0 commit comments

Comments
 (0)