mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-20 16:49:52 +00:00
Fix issue where change event would not fire on file selection
This commit is contained in:
parent
7bcdcdebde
commit
c53c5b57f8
1 changed files with 5 additions and 0 deletions
|
|
@ -34,6 +34,11 @@ export async function promptForFileReferences() {
|
|||
// Can this fail? Do we ever reject?
|
||||
const fileInput = document.createElement("input");
|
||||
fileInput.type = "file";
|
||||
// Not entirely sure why this is needed, since the input
|
||||
// was just created, but somehow this helps prevent change
|
||||
// events from getting swallowed.
|
||||
// https://stackoverflow.com/a/12102992/1263117
|
||||
fileInput.value = null;
|
||||
fileInput.addEventListener("change", e => {
|
||||
resolve(e.target.files);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue