Skip to content

πŸ™Œ OpenHands: AI-Driven Development

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

OpenHands92c166551f03
diff --git a/frontend/src/components/features/chat/chat-input.tsx b/frontend/src/components/features/chat/chat-input.tsx
index 44a86d675c..6cec5f42e0 100644
--- a/frontend/src/components/features/chat/chat-input.tsx
+++ b/frontend/src/components/features/chat/chat-input.tsx
@@ -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 = "";
}
}