Skip to content

BUG: animate.leave doesn't work correctly with transition delay #64209

Closed

Description

@froz-ilya

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

core

Is this a regression?

No

Description

When using a composite animation with animate.leave, the shortest animation is performed, after which the element is removed from the tree. Therefore, the remaining transitions/animations are not executed, and the animation does not perform as expected.

In the example above, clicking the "click me" button should trigger the opening animation (animate.enter) without any issues. However, when using animate.leave, we'll see that only the first transitions are executed (without a delay), after which the block abruptly disappears.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-sjuhgdmu?file=src%2Fapp%2Fapp.component.html

Please provide the exception or error you saw


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

Angular CLI: 20.3.3
Node: 22.17.0
Package Manager: yarn 1.22.22
OS: win32 x64


Angular: 20.3.3
... animations, build, cli, common, compiler, compiler-cli, core
... forms, platform-browser, platform-browser-dynamic, router

Package                      Version
------------------------------------
@angular-devkit/architect    0.2003.3
@angular-devkit/core         20.0.5
@angular-devkit/schematics   20.3.3
@angular/cdk                 20.2.7
@angular/material            20.2.7
@schematics/angular          20.3.3
rxjs                         7.8.1
typescript                   5.8.3
zone.js                      0.15.1

Anything else?

No response

Activity

  1. added
    P3
    core: animations
    area: core
    on Oct 2, 2025
  2. added this to the Backlog milestone on Oct 2, 2025
  3. thePunderWoman commented on Oct 2, 2025

    @thePunderWoman
    Contributor

    I can confirm this behavior. It looks like the code we have in place to ensure that host binding works properly results in the leave animation promise to be resolved early. There's likely a better solution here. So we'll investigate.

  4. added a commit that references this issue on Oct 3, 2025
    d41714a
  5. added 3 commits that reference this issue on Oct 3, 2025
    63c8e87
    6d222a5
    ba8ad97
  6. thePunderWoman commented on Oct 3, 2025

    @thePunderWoman
    Contributor

    @froz-ilya We have a PR to fix this, which should land on Monday. This fix should be included in next Wednesday's patch release.

  7. added a commit that references this issue on Oct 6, 2025
    3b95910
  8. added a commit that references this issue on Oct 6, 2025
    e279f30
  9. added a commit that references this issue on Oct 7, 2025
    24233eb
  10. added 2 commits that reference this issue on Oct 10, 2025
    df06631
    de54eb2
  11. angular-automatic-lock-bot commented on Nov 6, 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.

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

Metadata

Metadata

Labels

P3area: corecore: animationsstate: has PR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions