fix scroll sorting
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user