mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 14:01:20 +08:00
fix(modal): backdrop click catches navigation promise
A modal with canLeave = false, can lead to an unhandled exception when closing through a click in the backdrop
This commit is contained in:
@ -75,7 +75,9 @@ export class ModalCmp {
|
|||||||
|
|
||||||
_bdClick() {
|
_bdClick() {
|
||||||
if (this._enabled && this._bdDismiss) {
|
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');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user