Fix auto-scroll bug: add messages and streamingContent as dependencies to useEffect
This commit is contained in:
@@ -67,7 +67,7 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
|
|||||||
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(scrollToBottom, []);
|
useEffect(scrollToBottom, [messages, streamingContent]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
inputRef.current?.focus();
|
inputRef.current?.focus();
|
||||||
|
|||||||
Reference in New Issue
Block a user