Skip to content

Commit

Permalink
drag and drop onchange now triggers more than once with the same file…
Browse files Browse the repository at this point in the history
… name (#52)
  • Loading branch information
shaselton-usds authored Nov 25, 2024
1 parent 2a5cbbf commit 31da02b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/FileInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export const FileInput = ({
setFile(e.target.files.length > 0 ? e.target.files[0] : null)
if (onChange) onChange(e)
}
// Clear out the value to allow for the same filename to trigger the onChange multiple times in a row.
e.target.value = null
}

return (
Expand Down

0 comments on commit 31da02b

Please sign in to comment.