I am facing an issue in detecting a file input window close event in js
what I am trying:
<input type="file" />
const input = document.querySelector("input");
input.addEventListener("change", handleFileUpload);
async function handleFileUpload(event) {
if (event.userCancel) {
// <--- where can I get this?? or something similar in function
// do something
}
const files = event.target.files;
await doUpload(files); // upload the files
}
Any advice on how to fix this?