question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AnimationPlayer does not clear transform after animation ends

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/platform-browser/animations

Is this a regression?

This is reproducible in Angular 8 and in Angular 9-rc13.

Description

I am animating DOM element with AnimationPlayer. After animation end the inline style of the animated element is corrupted.

Note: this happens when animation is started via keydown handler. Issue does not reproduce if animation is started via button click

🔬 Minimal Reproduction

The issue is not reproducible in StackBlitz. Here is a repo showing the issue. Run the app and press esc key. This should start the animation. After animation ends the #content element’s style contains transform: matrix(1, 0, 0, 1, 0, -456.363);.

🔥 Exception or Error

There is no exceptions, nor errors, but the element inline style is poluted.

🌍 Your Environment

Angular Version:


Angular CLI: 8.3.24
Node: 12.13.1
OS: win32 x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms     
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------     
@angular-devkit/architect         0.803.24
@angular-devkit/build-angular     0.803.24
@angular-devkit/build-optimizer   0.803.24
@angular-devkit/build-webpack     0.803.24
@angular-devkit/core              8.3.24
@angular-devkit/schematics        8.3.24
@angular/cli                      8.3.24
@ngtools/webpack                  8.3.24
@schematics/angular               8.3.24
@schematics/update                0.803.24
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2

Anything else relevant? Happens only on Chrome 79.0.3945.130

Does not reproduce on: Opera 66.0.3515.44 Firefox 72.0.2 Microsoft Edge 44.18362.449.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
wnvkocommented, Aug 23, 2022

@dario-piotrowicz I cannot reproduce it also with latest Chrome. Closing the issue now.

1reaction
dario-piotrowiczcommented, Aug 21, 2022

As far as I can tell this issue doesn’t happen anymore

I have copied the repo’s code and run it locally (on Chrome 104) with v14 and after the animation (triggered by pressing esc as instructed) no transform property is present in the element’s styles: Screenshot at 2022-08-21 11-23-23 Screenshot at 2022-08-21 11-23-42

Read more comments on GitHub >

github_iconTop Results From Across the Web

Animation Player does not reset after scene change, but only ...
I ended up fixing it by setting up a reset animation, putting the buttons into a group and checking the scale of that...
Read more >
Add a "reset" animation to AnimationPlayer #1597 - GitHub
As RESET is an animation, it can be very easy to add your custom tracks, call functions, or inspect and change default values....
Read more >
AnimationPlayer animations do not play in Godot
First one is to somehow parameterize "Fader" scene. This can be done in many ways but at the end, when you initialize it...
Read more >
Position of objects in animation is reset after TimeLine finishes
Unity version 2018.2.12f1, no root motion, but I've tried with it too. The anim always goes back to the default state once the...
Read more >
AnimationPlayer - Angular
Provides programmatic control of a reusable animation sequence, built using the ... Provides a callback to invoke after the animation is destroyed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found