From 3bf710489d8a6627265a970e9ac1ff240f0cce58 Mon Sep 17 00:00:00 2001 From: Waleed Date: Tue, 9 Jun 2026 19:05:20 -0700 Subject: [PATCH] fix(mothership): clear chat input after sending a message mid-conversation (#4936) --- .../home/components/user-input/user-input.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/user-input/user-input.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/user-input/user-input.tsx index b95300c665..ea08732f59 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/user-input/user-input.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/user-input/user-input.tsx @@ -1099,9 +1099,10 @@ export const UserInput = forwardRef(function Us // Adopt value changes that bypassed React's change tracking (browser // autofill, password managers, grammar extensions — see facebook/react#2125) - // so state never drifts from the DOM. The render rebuilds the overlay and - // selection logic resumes on the next event. - if (textarea.value !== valueRef.current) { + // so state never drifts from the DOM. Skip when state is empty: submit clears + // `value` synchronously, but a select/mouseUp can fire while the textarea + // still holds the just-sent text, and adopting it would resurrect the message. + if (valueRef.current !== '' && textarea.value !== valueRef.current) { adoptDomValue(textarea) return }