← Back

BUG-A1E7D3ED: Chat input disappears

medium · ui · ready_for_review · 2026-08-21T14:45

Description

When typing a long message in the chat input, the text disappears after 5 seconds

Steps to Reproduce

1. Open chat\n2. Type a long message (50+ chars)\n3. Wait 5 seconds\n4. Text vanishes

LLM Triage

{"summary": "Chat input text vanishes after inactivity timeout", "severity": "medium", "category": "ui", "affected_files": ["/src/components/chat/Input.jsx", "/src/services/MessageService.js"], "root_cause": "Input element is cleared from DOM after 5 seconds of no new input, without checking for active typing state.", "suggested_fix": "Implement a timeout that only clears the input when user stops typing, or adjust the timeout duration based on user activity."}

Generated Patch

diff --git a/chat.js b/chat.js
index 1234567..89abcdef 100644
--- a/chat.js
+++ b/chat.js
@@ -10,7 +10,7 @@ function handleInput(event) {
     // Check if user is actively typing
     if (event.target.value.length > 0) {
         clearTimeout(timeoutId);
     } else {
-        timeoutId = setTimeout(() => {
+        timeoutId = setTimeout(() => {
             // Clear input only if user is not actively typing
             if (event.target.value.length === 0) {
                 event.target.value = '';
             }
         }, 5000);
     }
 }