Skip to content

Commit

Permalink
fix(blocks): resolve on file input dialog cancel (#6949)
Browse files Browse the repository at this point in the history
  • Loading branch information
shvixxl committed May 6, 2024
1 parent 3da634d commit e926fb4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/blocks/src/_common/utils/filesys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ export async function openFileOrFiles({
}
resolve(input.files[0]);
});
// The `cancel` event fires when the use cancels the dialog.
input.addEventListener('cancel', () => {
resolve(null);
});
// Show the picker.
if ('showPicker' in HTMLInputElement.prototype) {
input.showPicker();
Expand Down

0 comments on commit e926fb4

Please sign in to comment.