diff --git a/packages/animations/browser/src/render/transition_animation_engine.ts b/packages/animations/browser/src/render/transition_animation_engine.ts index 08942344be..0d3f06f820 100644 --- a/packages/animations/browser/src/render/transition_animation_engine.ts +++ b/packages/animations/browser/src/render/transition_animation_engine.ts @@ -1047,6 +1047,7 @@ export class TransitionAnimationEngine { // means that it is independent and therefore should be set for animation if (subTimelines.has(element)) { if (disabledElementsSet.has(element)) { + player.onDestroy(() => setStyles(element, instruction.toStyles)); skippedPlayers.push(player); return; } diff --git a/packages/core/test/animation/animation_integration_spec.ts b/packages/core/test/animation/animation_integration_spec.ts index 9b27d99efd..a4c695ed35 100644 --- a/packages/core/test/animation/animation_integration_spec.ts +++ b/packages/core/test/animation/animation_integration_spec.ts @@ -2618,6 +2618,57 @@ export function main() { expect(players[0].totalTime).toEqual(1234); }); + it('should ensure state() values are applied when an animation is disabled', () => { + @Component({ + selector: 'if-cmp', + template: ` +