Skip to content

Commit 7d162a5

Browse files
committed
fix: reset file input
1 parent 9c17cb4 commit 7d162a5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sites/preview/src/lib/components/tree/ContextMenu.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@
165165
const handleFileInputChange: EventHandler<Event, HTMLInputElement> = (event) => {
166166
onFilesSelected?.(event.currentTarget.files);
167167
onFilesSelected = undefined;
168+
169+
// Reset the input's "selected files" to prevent it from dispatching
170+
// the "cancel" event when the same files are reuploaded.
171+
event.currentTarget.value = "";
168172
};
169173
170174
const handleFileInputCancel: EventHandler<Event, HTMLInputElement> = () => {

0 commit comments

Comments
 (0)