Skip to content

Commit

Permalink
fix(FileUploader): clear hidden input value on file upload (#13327)
Browse files Browse the repository at this point in the history
* fix(FileUploader): clear hidden input value on file upload

* fix(FileUploaderButton): clear input before opening file selector

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
francinelucca and kodiakhq[bot] authored Mar 17, 2023
1 parent 70014c9 commit a2c4147
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ function FileUploaderButton({

function onClick(event) {
event.target.value = null;
inputNode.current.value = '';
inputNode.current.click();
}

function onKeyDown(event) {
if (matches(event, [keys.Enter, keys.Space])) {
inputNode.current.value = '';
inputNode.current.click();
}
}
Expand Down

0 comments on commit a2c4147

Please sign in to comment.