Skip to content

Commit

Permalink
fix(modal): catch error when beforeClose promise is rejected. #6381
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull committed Aug 24, 2023
1 parent b5fa7f4 commit 5a0e2b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/calcite-components/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,11 @@ export class Modal
}

if (this.beforeClose) {
await this.beforeClose(this.el);
try {
await this.beforeClose(this.el);
} catch (_error) {
return;
}
}

this.ignoreOpenChange = true;
Expand Down

0 comments on commit 5a0e2b6

Please sign in to comment.