Skip to content

BUG: animate.leave doesn't save styles till the end of the transition #64326

Closed

Description

@froz-ilya

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

Yes

Description

When using animate.leave, styles are not preserved until the end of the animation.

In the example above, clicking the "Toggle" button should trigger the component's closing animation (using grid-template-rows). The animation plays, but the element expands in size. This is likely not the expected behavior

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-cuyyzgnx

Please provide the exception or error you saw


Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 20.3.5
Node: 20.19.1
Package Manager: npm 10.8.2
OS: linux x64
    

Angular: 20.3.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, router

Package                      Version
------------------------------------
@angular-devkit/architect    0.2003.5
@angular-devkit/core         20.3.5
@angular-devkit/schematics   20.3.5
@angular/build               20.3.5
@angular/cli                 20.3.5
@schematics/angular          20.3.5
rxjs                         7.8.2
typescript                   5.8.2
zone.js                      0.15.0

Anything else?

This issue is likely related to the fixed bug #64209

Activity

  1. changed the title [-]BUG: animate.leave doesn't save styles till end of transition[/-] [+]BUG: animate.leave doesn't save styles till the end of the transition[/+] on Oct 9, 2025
  2. added
    area: core
    core: animations
    on Oct 9, 2025
  3. modified the milestone: needsTriage on Oct 9, 2025
  4. thePunderWoman commented on Oct 10, 2025

    @thePunderWoman
    Contributor

    This is definitely odd. It may be related to #64209, but it seems unlikely as that only affects combinations of animations using host bindings. It has no impact on the styles. We'll have to debug further.

  5. thePunderWoman commented on Oct 10, 2025

    @thePunderWoman
    Contributor

    OK, I've found the issue. The styles are getting prematurely pruned when the element is removed. This should be a quick fix. Thanks for the report.

  6. added a commit that references this issue on Oct 10, 2025
    d4c0591
  7. added a commit that references this issue on Oct 10, 2025
    8dbf130
  8. added a commit that references this issue on Oct 14, 2025
    d54dd67
  9. added a commit that references this issue on Oct 14, 2025
    e228102
  10. angular-automatic-lock-bot commented on Nov 14, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  11. locked and limited conversation to collaborators on Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area: corecore: animationsstate: has PR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions