fix(nav): prevent completing transition from being interrupted (#19113)

* do not enable swipe to begin before previous one has ended

* update defaults

* use canStart instead

* pause animations on finish

* remove old pause code
This commit is contained in:
Liam DeBeasi
2019-08-16 13:33:39 -04:00
committed by GitHub
parent 624e118b56
commit fd65765bdf
3 changed files with 22 additions and 6 deletions

View File

@ -18,6 +18,7 @@ export class Nav implements NavOutlet {
private transInstr: TransitionInstruction[] = [];
private sbAni?: Animation | IonicAnimation;
private animationEnabled = true;
private useRouter = false;
private isTransitioning = false;
private destroyed = false;
@ -937,6 +938,7 @@ export class Nav implements NavOutlet {
!!this.swipeGesture &&
!this.isTransitioning &&
this.transInstr.length === 0 &&
this.animationEnabled &&
this.canGoBackSync()
);
}
@ -960,6 +962,10 @@ export class Nav implements NavOutlet {
private onEnd(shouldComplete: boolean, stepValue: number, dur: number) {
if (this.sbAni) {
this.animationEnabled = false;
this.sbAni.onFinish(() => {
this.animationEnabled = true;
}, { oneTimeCallback: true });
this.sbAni.progressEnd(shouldComplete, stepValue, dur);
}
}