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