Closed mikeAtHexosIp closed 3 years ago
Thanks for filing this, but I can't reproduce the reported issue. If you open the demo and place a breakpoint on line 47 of script.mjs
with DevTools and then click the Open Image File button, you can see that the demo catches the error and checks if the reason is an abort:
@tomayac thanks for looking into this! I just gave this a try in Firefox Developer Edition, latest version, and if I cancel from Open Image File button it doesn't hit the breakpoint. I think it may have something to do with the polyfill fallback.
Just discussed this offline with @Snugug. I’ll make sure this throws in the fallback case, too.
@mikeAtHexosIp Thanks again for reporting this. I have just release v0.14.0
that includes this fix.
Safari Web Inspector:
The API works fine when selecting files and also handles rejection when the chosen file is not valid, but when the user dismiss the file picker prompt without selecting any file, execution gets stuck in await fileOpen().
Code sample:
AC: Reject promise in fileOpen function when file picker prompt is dismissed