TomokiMiyauci/file-select-dialog

Promise never resolves when dialog is canceled

Opened this issue · 2 comments

dlech commented

If the user clicks "Cancel" in the file dialog that is shown, the promise never resolves. If code is written using async/await, this means that the function that is awaiting the promise is leaked (it will always be waiting forever).

There are some suggestions how to address this here: https://stackoverflow.com/questions/34855400/cancel-event-on-input-type-file

@dlech Thanks for the report.

I will investigate the solution.

dlech commented

Later, I found that a "cancel" event has been added to <input type="file"> elements in the HTML spec: whatwg/html#6735

I'm not sure that any browser has implemented this yet though.