fix scroll sorting

This commit is contained in:
2026-04-15 13:05:50 -06:00
parent 762f01ae71
commit 1146d3c768
5 changed files with 14 additions and 12 deletions

View File

@@ -45,9 +45,9 @@ function ChatPage() {
lastScrolledIdRef.current = lastMsg.id;
const area = messagesAreaRef.current;
if (!area) return;
const nearBottom = area.scrollHeight - area.scrollTop - area.clientHeight < 150;
const nearBottom = area.scrollHeight - area.scrollTop - area.clientHeight < 80;
if (nearBottom) {
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
area.scrollTop = area.scrollHeight;
}
}, [messages]);