fix: agentic chat resolve input not clearing after submission
What does this MR do?
This MR fixes a bug where the chat input field would not clear after sending a message in Agentic Chat, leaving the previous message text visible in the input area.
Will fix: gitlab#550599 (closed)
Screenshots or screen recordings
| before | after |
|---|---|
| 2025-06-27_13-23-52 | 2025-06-27_13-23-15 |
Root Cause
The issue was caused by a race condition in the sendChatPrompt() method:
- User sends a message
-
canSubmitis set tofalse, disabling the textarea -
setPromptAndFocus()attempts to clear the prompt asynchronously - Disabled textarea prevents the
v-modelbinding from updating the DOM - Input appears to still contain the previous message
Solution
- Made
sendChatPrompt()async and addedawaitbeforesetPromptAndFocus() - This ensures the prompt clearing completes before the textarea gets disabled
- Proper execution order: emit → clear → disable
Edited by Jannik Lehmann