From 9b650229f77b16db912e67ef36f9abd765753bc8 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Fri, 30 Sep 2016 20:15:31 +0200 Subject: [PATCH] fix(nav): push-pop pages too quickly fixes #8319 --- src/navigation/nav-controller-base.ts | 3 ++- src/navigation/view-controller.ts | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/navigation/nav-controller-base.ts b/src/navigation/nav-controller-base.ts index e7ae3a64e5f..bd5ff1a7ec6 100644 --- a/src/navigation/nav-controller-base.ts +++ b/src/navigation/nav-controller-base.ts @@ -623,7 +623,7 @@ export class NavControllerBase extends Ion implements NavController { const duration = trns.getDuration(); // set that this nav is actively transitioning - this.setTransitioning(true, duration); + this.setTransitioning(true, duration + ACTIVE_TRANSITION_OFFSET); if (!trns.parent) { // this is the top most, or only active transition, so disable the app @@ -959,3 +959,4 @@ let ctrlIds = -1; const DISABLE_APP_MINIMUM_DURATION = 64; const ACTIVE_TRANSITION_MAX_TIME = 5000; +const ACTIVE_TRANSITION_OFFSET = 200; \ No newline at end of file diff --git a/src/navigation/view-controller.ts b/src/navigation/view-controller.ts index 9f66efc1cf3..34615982e33 100644 --- a/src/navigation/view-controller.ts +++ b/src/navigation/view-controller.ts @@ -30,7 +30,7 @@ export class ViewController { private _cntRef: ElementRef; private _hdrDir: Header; private _ftrDir: Footer; - private _hidden: string; + private _isHidden: boolean = false; private _leavingOpts: NavOptions; private _nb: Navbar; private _onDidDismiss: Function; @@ -273,10 +273,11 @@ export class ViewController { // doing checks to make sure we only update the DOM when actually needed if (this._cmp) { // if it should render, then the hidden attribute should not be on the element - if (shouldShow && this._hidden === '' || !shouldShow && this._hidden !== '') { - this._hidden = (shouldShow ? null : ''); + if (shouldShow === this._isHidden) { + this._isHidden = !shouldShow; + let value = (shouldShow ? null : ''); // ******** DOM WRITE **************** - renderer.setElementAttribute(this.pageRef().nativeElement, 'hidden', this._hidden); + renderer.setElementAttribute(this.pageRef().nativeElement, 'hidden', value); } } }