mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 17:42:15 +08:00
fix(angular): per-page animations now work with swipe to go back (#21706)
resolves #21692
This commit is contained in:
@ -127,7 +127,7 @@ export class StackController {
|
|||||||
* Save any custom animation so that navigating
|
* Save any custom animation so that navigating
|
||||||
* back will use this custom animation by default.
|
* back will use this custom animation by default.
|
||||||
*/
|
*/
|
||||||
if (animationBuilder !== undefined && leavingView) {
|
if (leavingView) {
|
||||||
leavingView.animationBuilder = animationBuilder;
|
leavingView.animationBuilder = animationBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,13 +190,16 @@ export class StackController {
|
|||||||
if (leavingView) {
|
if (leavingView) {
|
||||||
const views = this.getStack(leavingView.stackId);
|
const views = this.getStack(leavingView.stackId);
|
||||||
const enteringView = views[views.length - 2];
|
const enteringView = views[views.length - 2];
|
||||||
|
const customAnimation = enteringView.animationBuilder;
|
||||||
|
|
||||||
return this.wait(() => {
|
return this.wait(() => {
|
||||||
return this.transition(
|
return this.transition(
|
||||||
enteringView, // entering view
|
enteringView, // entering view
|
||||||
leavingView, // leaving view
|
leavingView, // leaving view
|
||||||
'back',
|
'back',
|
||||||
this.canGoBack(2),
|
this.canGoBack(2),
|
||||||
true
|
true,
|
||||||
|
customAnimation
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user