Skip to content

fix(core): fixes empty animations when recalculating styles #63007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

thePunderWoman
Copy link
Contributor

@thePunderWoman thePunderWoman commented Aug 5, 2025

Any time something causes styles to recalculate,element.getAnimations() will be empty. This updates animate.enter and animate.leave to rely on getComputedStyles as a fallback to determine the longest animation.

This should also improve performance as this reduces the calls to get the longest animation only when the event.target is the element in question. It'll ignore bubbled up animation events now.

fixes: #63006

@thePunderWoman thePunderWoman added action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime target: minor This PR is targeted for the next minor release labels Aug 5, 2025
@ngbot ngbot bot added this to the Backlog milestone Aug 5, 2025
@thePunderWoman thePunderWoman force-pushed the robust-fix branch 2 times, most recently from 7e6ca5c to e53d841 Compare August 5, 2025 13:14
Any time something causes styles to recalculate,
`element.getAnimations()` will be empty. This updates `animate.enter`
and `animate.leave` to rely on `getComputedStyles` to determine the
longest animation instead.

fixes: angular#63006
@thePunderWoman thePunderWoman removed the request for review from JeanMeche August 6, 2025 08:23
@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 6, 2025
@ngbot
Copy link

ngbot bot commented Aug 6, 2025

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "google-internal-tests" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken main, please try rebasing to main and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@crisbeto
Copy link
Member

crisbeto commented Aug 6, 2025

This PR was merged into the repository by commit ebd622b.

The changes were merged into the following branches: main

@crisbeto crisbeto closed this in ebd622b Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Style recalculations will cause animate.enter and animate.leave to misbehave
2 participants