diff --git a/js/fileUtils.js b/js/fileUtils.js index 876448d7..b17b046c 100644 --- a/js/fileUtils.js +++ b/js/fileUtils.js @@ -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); });