Skip to content

Commit

Permalink
fix(modal): backdrop click catches navigation promise
Browse files Browse the repository at this point in the history
A modal with canLeave = false, can lead to an unhandled exception when closing through a click in the backdrop
  • Loading branch information
manucorporat committed Nov 19, 2016
1 parent 053c754 commit e46d8d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/modal/modal-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export class ModalCmp {

_bdClick() {
if (this._enabled && this._bdDismiss) {
return this._viewCtrl.dismiss(null, 'backdrop');
return this._viewCtrl.dismiss(null, 'backdrop').catch(() => {
console.debug('Dismiss modal by clicking backdrop was cancelled');
});
}
}

Expand Down

0 comments on commit e46d8d6

Please sign in to comment.