mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
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:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user