From 2664587749e45100a04f70796733de162b26cdf7 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Fri, 10 Jul 2020 09:38:58 -0400 Subject: [PATCH] fix(angular): per-page animations now work with swipe to go back (#21706) resolves #21692 --- angular/src/directives/navigation/stack-controller.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/angular/src/directives/navigation/stack-controller.ts b/angular/src/directives/navigation/stack-controller.ts index 3274277833..a7713fb80a 100644 --- a/angular/src/directives/navigation/stack-controller.ts +++ b/angular/src/directives/navigation/stack-controller.ts @@ -127,7 +127,7 @@ export class StackController { * Save any custom animation so that navigating * back will use this custom animation by default. */ - if (animationBuilder !== undefined && leavingView) { + if (leavingView) { leavingView.animationBuilder = animationBuilder; } @@ -190,13 +190,16 @@ export class StackController { if (leavingView) { const views = this.getStack(leavingView.stackId); const enteringView = views[views.length - 2]; + const customAnimation = enteringView.animationBuilder; + return this.wait(() => { return this.transition( enteringView, // entering view leavingView, // leaving view 'back', this.canGoBack(2), - true + true, + customAnimation ); }); }