fix(ux): remove Backspace shortcut for deleting prompt attachments (#3410)

* Remove backspace attachment deletion

* Fix the lint error

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
Nan Gao
2026-06-06 09:13:24 +02:00
committed by GitHub
parent 1aac408dd0
commit 9a5de8d6a5
@@ -911,19 +911,6 @@ export const PromptInputTextarea = ({
form?.requestSubmit(); 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<HTMLTextAreaElement> = (event) => { const handlePaste: ClipboardEventHandler<HTMLTextAreaElement> = (event) => {