From 29574ef5d89d8adb248766458578fadd367a75d8 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Thu, 19 Mar 2026 08:45:09 +0530 Subject: [PATCH] fix: Correct chat auto-scroll to bottom by setting container's scrollTop property instead of using scrollIntoView. --- src/app/support/chat/page.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/support/chat/page.tsx b/src/app/support/chat/page.tsx index 69ef148..a4ef733 100644 --- a/src/app/support/chat/page.tsx +++ b/src/app/support/chat/page.tsx @@ -138,9 +138,12 @@ export default function SupportChatPage() { }; }, [chat, currentUserId]); - // Auto-scroll to bottom on new messages + // Auto-scroll to bottom on new messages (scroll container, not page) useEffect(() => { - messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' }); + const container = messagesContainerRef.current; + if (container) { + container.scrollTop = container.scrollHeight; + } }, [messages]); // Send message