Skip to content

Commit 6e4ea5b

Browse files
committed
Patch minor bug related to message not focusing on input after reply from chatbot
1 parent 478cd0d commit 6e4ea5b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

frontend/src/pages/Chat/components/MessageWindow.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ export default function MessageWindow({
3131
};
3232

3333
useEffect(() => {
34-
inputRef.current?.focus();
3534
const messagesElement = messagesRef.current;
3635
if (messagesElement) {
3736
messagesElement.scrollTo({
3837
top: messagesElement.scrollHeight,
3938
behavior: "smooth",
4039
});
40+
setTimeout(() => {
41+
inputRef.current?.focus();
42+
}, 500);
4143
}
4244
}, [messages]);
4345

@@ -106,9 +108,7 @@ export default function MessageWindow({
106108
>
107109
Clear Chat
108110
</button>
109-
<div className="">
110-
<ExportMessagesButton messages={messages} />
111-
</div>
111+
<ExportMessagesButton messages={messages} />
112112
</div>
113113
) : null}
114114
</div>

0 commit comments

Comments
 (0)