From f4a9fe29a3b9ef4050d5d4ec45c1da74fcd42a21 Mon Sep 17 00:00:00 2001 From: Andrew Maguire Date: Thu, 19 Mar 2026 13:53:44 +0200 Subject: [PATCH] fix(app): ignore repeated Enter submits in prompt input (#18148) Co-authored-by: Shoubhit Dash --- packages/app/src/components/prompt-input.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index 5c25235c6..55cfaa490 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -1241,6 +1241,20 @@ export const PromptInput: Component = (props) => { // Note: Shift+Enter is handled earlier, before IME check if (event.key === "Enter" && !event.shiftKey) { + event.preventDefault() + if (event.repeat) return + if ( + working() && + prompt + .current() + .map((part) => ("content" in part ? part.content : "")) + .join("") + .trim().length === 0 && + imageAttachments().length === 0 && + commentCount() === 0 + ) { + return + } handleSubmit(event) } }