From 9a5de8d6a5a75c9f277a79d36b90407e3029a1ba Mon Sep 17 00:00:00 2001 From: Nan Gao Date: Sat, 6 Jun 2026 09:13:24 +0200 Subject: [PATCH] fix(ux): remove Backspace shortcut for deleting prompt attachments (#3410) * Remove backspace attachment deletion * Fix the lint error --------- Co-authored-by: Willem Jiang --- .../src/components/ai-elements/prompt-input.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/frontend/src/components/ai-elements/prompt-input.tsx b/frontend/src/components/ai-elements/prompt-input.tsx index 4609c43d3..ff19be843 100644 --- a/frontend/src/components/ai-elements/prompt-input.tsx +++ b/frontend/src/components/ai-elements/prompt-input.tsx @@ -911,19 +911,6 @@ export const PromptInputTextarea = ({ form?.requestSubmit(); } - - // Remove last attachment when Backspace is pressed and textarea is empty - if ( - e.key === "Backspace" && - e.currentTarget.value === "" && - attachments.files.length > 0 - ) { - e.preventDefault(); - const lastAttachment = attachments.files.at(-1); - if (lastAttachment) { - attachments.remove(lastAttachment.id); - } - } }; const handlePaste: ClipboardEventHandler = (event) => {