diff --git a/.changeset/thin-suns-train.md b/.changeset/thin-suns-train.md new file mode 100644 index 00000000..c7d79f93 --- /dev/null +++ b/.changeset/thin-suns-train.md @@ -0,0 +1,5 @@ +--- +"ai-elements": patch +--- + +fix(prompt-input): Reset file input value to allow re-selecting previously removed files diff --git a/packages/elements/src/prompt-input.tsx b/packages/elements/src/prompt-input.tsx index ae522f80..53c86daf 100644 --- a/packages/elements/src/prompt-input.tsx +++ b/packages/elements/src/prompt-input.tsx @@ -653,6 +653,8 @@ export const PromptInput = ({ if (event.currentTarget.files) { add(event.currentTarget.files); } + // Reset input value to allow selecting files that were previously removed + event.currentTarget.value = ""; }; const convertBlobUrlToDataUrl = async (url: string): Promise => {