Skip to content

Commit a726985

Browse files
fix(prompt-input): Reset file input value to allow re-selecting previously removed files (#257)
* fix(prompt-input): Reset file input value to allow re-selecting previously removed files * Create thin-suns-train.md --------- Co-authored-by: Hayden Bleasel <[email protected]>
1 parent 21a07f5 commit a726985

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/thin-suns-train.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"ai-elements": patch
3+
---
4+
5+
fix(prompt-input): Reset file input value to allow re-selecting previously removed files

packages/elements/src/prompt-input.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,8 @@ export const PromptInput = ({
653653
if (event.currentTarget.files) {
654654
add(event.currentTarget.files);
655655
}
656+
// Reset input value to allow selecting files that were previously removed
657+
event.currentTarget.value = "";
656658
};
657659

658660
const convertBlobUrlToDataUrl = async (url: string): Promise<string> => {

0 commit comments

Comments
 (0)