fix: scroll para ultima mensagem apos enviar no chat web
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 <noreply@anthropic.com>
This commit is contained in:
parent
8798566b7f
commit
c65e37e232
1 changed files with 4 additions and 0 deletions
|
|
@ -567,6 +567,10 @@ export function ChatWidget() {
|
||||||
})
|
})
|
||||||
setAttachments([])
|
setAttachments([])
|
||||||
inputRef.current?.focus()
|
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) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
toast.error("Não foi possível enviar a mensagem.")
|
toast.error("Não foi possível enviar a mensagem.")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue