From fba159662e0f58f81d62a84a42511b39d7a85e3b Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Thu, 8 Dec 2016 23:54:27 +0100 Subject: [PATCH] fix(modal): overlay-zindex is not changed in back direction fixes #9409 --- src/components/modal/test/basic/app.module.ts | 12 ++++++++++-- src/navigation/nav-util.ts | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/modal/test/basic/app.module.ts b/src/components/modal/test/basic/app.module.ts index cc872f1be4..f895ccc670 100644 --- a/src/components/modal/test/basic/app.module.ts +++ b/src/components/modal/test/basic/app.module.ts @@ -441,6 +441,9 @@ export class ContactUs {

+

+ +

@@ -460,8 +463,9 @@ export class ModalFirstPage { public app: App, public actionSheetCtrl: ActionSheetController, public toastCtrl: ToastController, - public alertCtrl: AlertController) { - + public alertCtrl: AlertController, + public modalCtrl: ModalController, + ) { for (let i = 0; i < 50; i++) { this.items.push({ value: (i + 1) @@ -550,6 +554,10 @@ export class ModalFirstPage { this.called.ionViewDidLeave++; } + openModal() { + this.modalCtrl.create(ContactUs).present(); + } + openActionSheet() { let actionSheet = this.actionSheetCtrl.create({ buttons: [ diff --git a/src/navigation/nav-util.ts b/src/navigation/nav-util.ts index aade5a88e7..277b2ad16a 100644 --- a/src/navigation/nav-util.ts +++ b/src/navigation/nav-util.ts @@ -58,7 +58,9 @@ let portalZindex = 9999; export function setZIndex(nav: NavControllerBase, enteringView: ViewController, leavingView: ViewController, direction: string, renderer: Renderer) { if (enteringView) { if (nav._isPortal) { - enteringView._setZIndex(nav._zIndexOffset + portalZindex, renderer); + if (direction === DIRECTION_FORWARD) { + enteringView._setZIndex(nav._zIndexOffset + portalZindex, renderer); + } portalZindex++; return; }