Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix uploading same file twice in a row in Chromium
To upload files a hidden file input is "clicked", which shows the browser dialog to pick the files, and the "change" event of the file input is listened to to know the selected files. However, although Firefox always emits the "change" event when files are selected, Chromium only emits the "change" event if the selected files have changed since the last time. Due to this if a file was uploaded and then the same file was tried to be uploaded again nothing happened. Now the value of the file input is cleared (which also clears the files from the file input) after the files are handled to ensure that there is no previous state when the browser dialog is shown again, and thus the selected files always change. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
- Loading branch information