mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
fix(nav): immediately stop if view removed before trans finished
This commit is contained in:
@ -692,31 +692,14 @@ export class NavController extends Ion {
|
|||||||
if (forcedActive) {
|
if (forcedActive) {
|
||||||
// this scenario happens when a remove is going on
|
// this scenario happens when a remove is going on
|
||||||
// during a transition
|
// during a transition
|
||||||
let resolve;
|
|
||||||
let promise = new Promise(res => { resolve = res; });
|
|
||||||
|
|
||||||
if (!opts.animation) {
|
|
||||||
opts.animation = forcedActive.getTransitionName(opts.direction);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._trans) {
|
if (this._trans) {
|
||||||
this._trans
|
this._trans.stop();
|
||||||
.onFinish(() => {
|
|
||||||
opts.animate = false;
|
|
||||||
this._transition(forcedActive, null, opts, (hasCompleted: boolean) => {
|
|
||||||
// transition has completed!!
|
|
||||||
resolve(hasCompleted);
|
|
||||||
});
|
|
||||||
}, false, true)
|
|
||||||
.stop();
|
|
||||||
this._trans.destroy();
|
this._trans.destroy();
|
||||||
this._trans = null;
|
this._trans = null;
|
||||||
|
this._cleanup();
|
||||||
} else {
|
|
||||||
resolve(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return promise;
|
return Promise.resolve(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user