Skip to content

Commit b25ac12

Browse files
committed
fix clear input ref value
1 parent 8dd45a7 commit b25ac12

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/useCSVReader.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ function useCSVReaderComponent<
198198
const openFileDialog = useCallback(() => {
199199
if (inputRef.current && state.displayProgressBar) {
200200
dispatch({ type: 'openDialog' });
201+
inputRef.current.value = '';
201202
inputRef.current.files = null;
202203
inputRef.current.click();
203204
}
@@ -605,6 +606,7 @@ function useCSVReaderComponent<
605606

606607
const removeFileProgrammaticallyCb = useCallback((event: Event) => {
607608
if (inputRef.current) {
609+
inputRef.current.value = '';
608610
inputRef.current.files = null;
609611
}
610612
dispatch({ type: 'reset' });

0 commit comments

Comments
 (0)