Skip to content

Commit 5c6cb4e

Browse files
committed
fix[frontend]: greater grace
1 parent e32f8d6 commit 5c6cb4e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

frontend/src/assets/Chat.svelte

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@
2525
2626
afterUpdate(() => {
2727
if (shouldAutoScroll) {
28-
chatElement.scrollIntoView({
29-
behavior: "smooth",
30-
block: "end",
31-
});
28+
chatElement.scrollIntoView(false);
3229
}
3330
});
3431
3532
function onScroll() {
3633
const elem = document.getElementById("chat-messages");
37-
shouldAutoScroll = (elem.scrollHeight - elem.scrollTop) - 30
34+
shouldAutoScroll = (elem.scrollHeight - elem.scrollTop) - 60
3835
<= elem.clientHeight; // 20px grace
3936
}
4037
</script>

0 commit comments

Comments
 (0)