Fix: Fixed the issue where the agent's chat box could not automatically scroll to the bottom #3221 (#9219)

### What problem does this PR solve?

Fix: Fixed the issue where the agent's chat box could not automatically
scroll to the bottom #3221

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2025-08-05 09:26:15 +08:00
committed by GitHub
parent 9db999ccae
commit dda5a0080a
6 changed files with 44 additions and 27 deletions

View File

@ -50,7 +50,8 @@ const ChatContainer = () => {
handleInputChange,
value,
sendLoading,
ref,
scrollRef,
messageContainerRef,
derivedMessages,
hasError,
stopOutputMessage,
@ -149,6 +150,7 @@ const ChatContainer = () => {
className={cn(
'flex flex-1 flex-col overflow-auto scrollbar-auto m-auto w-5/6',
)}
ref={messageContainerRef}
>
<div>
{derivedMessages?.map((message, i) => {
@ -203,7 +205,7 @@ const ChatContainer = () => {
);
})}
</div>
<div ref={ref.scrollRef} />
<div ref={scrollRef} />
</div>
<div className="flex w-full justify-center mb-8">
<div className="w-5/6">