Fix issue #5563: [Bug]: Prompt is not deleted when the user sends a message (#5564)

This commit is contained in:
OpenHands 2024-12-12 13:06:40 -05:00 committed by GitHub
parent ebb68b33db
commit 92c166551f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,11 +83,11 @@ export function ChatInput({
};
const handleSubmitMessage = () => {
if (value || (textareaRef.current?.value && !value)) {
onSubmit(value || textareaRef.current?.value || "");
if (value) {
onChange?.("");
} else if (textareaRef.current) {
const message = value || textareaRef.current?.value || "";
if (message) {
onSubmit(message);
onChange?.("");
if (textareaRef.current) {
textareaRef.current.value = "";
}
}