diff --git a/src/components/alert/alert-component.ts b/src/components/alert/alert-component.ts index 8e542e88a6e..8fabda89e16 100644 --- a/src/components/alert/alert-component.ts +++ b/src/components/alert/alert-component.ts @@ -194,9 +194,14 @@ export class AlertCmp { } ionViewDidLeave() { + focusOutActiveElement(); this.gestureBlocker.unblock(); } + ionViewWillLeave() { + focusOutActiveElement(); + } + ionViewDidEnter() { // focus out of the active element focusOutActiveElement(); @@ -254,7 +259,6 @@ export class AlertCmp { if (shouldDismiss) { this.dismiss(button.role); - focusOutActiveElement(); } } @@ -294,7 +298,6 @@ export class AlertCmp { } dismiss(role: any): Promise { - focusOutActiveElement(); return this._viewCtrl.dismiss(this.getValues(), role); }