Visitar URL original
`animateChild` does not work when used in router transitions · Issue #30477 · angular/angular · GitHub
The Wayback Machine - https://web.archive.org/web/20211008114606/https://github.com/angular/angular/issues/30477
Skip to content
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

animateChild does not work when used in router transitions #30477

Open
Ploppy3 opened this issue May 15, 2019 · 9 comments
Open

animateChild does not work when used in router transitions #30477

Ploppy3 opened this issue May 15, 2019 · 9 comments

Comments

@Ploppy3
Copy link

@Ploppy3 Ploppy3 commented May 15, 2019 •

🐞 bug report

Affected Package

The issue is caused by package @angular/animations

Is this a regression?

It never worked

Description

animateChild does not work when used in router transitions as explained in the official documentation

animateChild should start child transitions but nothing happens.

🔬 Minimal Reproduction

stackblitz

'Content page x' should be red and slowly switch back to black when switching page.

Remove the [@routerAnimations]="prepareRoute(outlet)" and switch page to confirm that the animation is working but just not triggered.

🔥 Exception or Error





No error shown.

🌍 Your Environment

Angular Version:




@angular@7.2.15

Anything else relevant?

@ngbot ngbot bot added this to the needsTriage milestone May 15, 2019
@ngbot ngbot bot removed this from the needsTriage milestone May 16, 2019
@ngbot ngbot bot added this to the Backlog milestone May 16, 2019
@GISerWYJ
Copy link

@GISerWYJ GISerWYJ commented May 17, 2019

@Ploppy3 This is not a bug.
Here is a updated link. which works as you expected.
stackblitz
The reason why the div is not animated is when your page is in a enter state, the div element is already entered in its parent earlier ! so the '@redtoblack' bind to the div won't work as expected,because the div is not match the ':enter' state.

The right way to do is bind the 'redToBack' to the _ page_:
image
and modify the animation definition using query to find the div ,then animate it !
image

@Ploppy3
Copy link
Author

@Ploppy3 Ploppy3 commented May 17, 2019 •

@GISerWYJ Sorry but this is not what I want, I want the individual elements/components of my page to render with their own animation. This is a minimal reproduction of the problem. I don't want the page to be animated.

Nb: If you look closely your animation has a issue where the previous page disappear instantly.

@brandon-sigao
Copy link

@brandon-sigao brandon-sigao commented Jan 10, 2020 •

I'm having the exact same problem. I've tried just about every possible way I can think of to get animations to run on the pages that are entering/leaving and it just ignores them.

Edit 1:

It appears to ignore all child animations completely if the animation is on an element of the page being transitioned. However if I apply an animation to the page component via host binding, then use animateChild in THAT trigger (essentially going 2 levels deep with animateChild), it does something. Unfortunately, what it does is completely remove the leaving page instantly with no animations at all. But hey, at least something changed...

@ciesielskico
Copy link

@ciesielskico ciesielskico commented May 16, 2020

Running into the same issue

@wibimaster
Copy link

@wibimaster wibimaster commented Jul 20, 2020

Same too :(

@michaelurban
Copy link

@michaelurban michaelurban commented Aug 21, 2021 •

Can we get a status update? Is someone working on this? Are there any suggested workarounds?

Basic functionality being broken, without comment, for 6-7 major releases is not a great position to be in.

For clarity, Angular 7 was released in October of 2018. A feature that's listed in the official docs at least four times has been broken for three (3!) years without comment or movement.

What's going on?

@michaelurban
Copy link

@michaelurban michaelurban commented Sep 27, 2021 •

I'm unable to implement my team's visual+motion design using Angular animations because basic, documented, functionality is broken. It's been two years since this featured was accepted as broken, is there any kind of an update?

@Ploppy3
Copy link
Author

@Ploppy3 Ploppy3 commented Sep 28, 2021

@matsko ping

@michaelurban
Copy link

@michaelurban michaelurban commented Sep 28, 2021 •

@jelbourn Would you consider bumping this to P2 as it's such a fundamental bit of functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
9 participants