Angular router animation exposing elements that was hidden by animation
See original GitHub issueπ bug report
Affected Package
The issue is probably caused by package @angular/animationsIs this a regression?
Yes, in Angular 8.x this was ok.Description
Iβm trying to upgrade my Angular project from 8.x to 9. Once Iβve done following the upgrade instructions, Iβve noticed that on one page that contains inner animation on it that supposed to hide certain element, becomes visible during router animation. I synthesized the issue to small project that demonstrate the issue (can be also found in StackBlitz: https://stackblitz.com/edit/angular-jbcamx)
π¬ Minimal Reproduction
https://stackblitz.com/edit/angular-jbcamxπ₯ Exception or Error
π Your Environment
Angular Version:
Angular CLI: 9.1.1
Node: 14.0.0
OS: win32 x64
Angular: 9.1.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.901.1
@angular-devkit/build-angular 0.901.1
@angular-devkit/build-optimizer 0.901.1
@angular-devkit/build-webpack 0.901.1
@angular-devkit/core 9.1.1
@angular-devkit/schematics 9.1.1
@angular/cdk 9.2.1
@angular/cli 9.1.1
@ngtools/webpack 9.1.1
@schematics/angular 9.1.1
@schematics/update 0.901.1
rxjs 6.5.5
typescript 3.8.3
webpack 4.42.0
Anything else relevant?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Angular animation gets hidden behind the other elements
I have the following angular animation which animates (move) the div from source to target coordinates. Issue 1: Somehow the animation isΒ ...
Read more >Route transition animations
Illustrate a router transition animation by navigating between two routes, Home and About ... Animations can be defined directly inside your components.
Read more >Ionic Routing And Router Animations In Angular
Ionic's router enables us to write routing animations and page ... The stack and hidden DOM elements are critical for Ionics pageΒ ...
Read more >Practical, real-world animation examples with Angular
In this blog, I will who show six examples of practical, real-world animations using Angular's animation capability, and will explain in detail how...
Read more >Interaction | NativeScript
Access CSS animations from code #. The simplest way to trigger a CSS animation is by changing the element className property: Example 15:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @ismailcherri for looking into it.
npm install
andng serve
, my issue does reproduced (only locally). Downgrading to Angular 8 fixes the issue without code change.test.component.ts
where I defined the inner animation, I have wildcard state transition like* => *
(I have only 2 states). If I change the transition tohide <=> show
(it should be equivalent as I understand it), the issue that can be seen in stackblitz is solved without adding theheight: 0px
Your example doesnβt work as intended or doesnβt demonstrate the bug correctly. Even when router animation is disabled, the issue is still there. The
height: 0px
takes some milliseconds to be applied. If you add it to the inline style, the issue is gone. Example: