From c65e37e232c5f8f2a117bdc5f3b10cf89c110785 Mon Sep 17 00:00:00 2001 From: rever-tecnologia Date: Thu, 11 Dec 2025 16:43:54 -0300 Subject: [PATCH] fix: scroll para ultima mensagem apos enviar no chat web MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adiciona scroll explicito apos enviar mensagem com sucesso para garantir que a mensagem mais recente fique visivel. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/components/chat/chat-widget.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/chat/chat-widget.tsx b/src/components/chat/chat-widget.tsx index 0363098..ef1d89a 100644 --- a/src/components/chat/chat-widget.tsx +++ b/src/components/chat/chat-widget.tsx @@ -567,6 +567,10 @@ export function ChatWidget() { }) setAttachments([]) inputRef.current?.focus() + // Scroll para o final após enviar (com pequeno delay para garantir que a mensagem foi renderizada) + setTimeout(() => { + messagesEndRef.current?.scrollIntoView({ behavior: "smooth" }) + }, 100) } catch (error) { console.error(error) toast.error("Não foi possível enviar a mensagem.")