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
ngIf="false" will prevent transition(":leave") animation #30732
Comments
(:leave)
animation(:leave)
animation
(:leave)
animation
#15798 (comment) |
Any update about this issue? I am on version 9.1.10, and seems like the issue still exists. |
bump. any update ? |
This issue seems to persist even in Angular 12. In my case the ngIf is on the div of the animation. But only the enter animation is played. Layout: <section *ngFor="let item of items; let idx = index">
<div>
<button (click)="toggleOpen(idx)">Button</button
</div>
<div *ngIf="isOpen(idx)" @ngIfAnimation>
<!-- content -->
</div>
</section> |
Hi @diverent2, I believe this is the exact problem that also the issues you mentioned in you description (#29509, #29496) refer to. I commented on those issues that the behaviour there was the expected one, I think that You can check my comments in those issues, but tldr not all elements leaving the dom are considered for I hope this helps 🙂 I don't think that anything can be done in this issue since it doesn't have a minimal reproduction and what it is describing is too vague and can very easily relate to something working as expected (but not clearly documented) If possible I would suggest to close this issue as it is either working as expected or it is a duplicate of the other two (or if you really believe that it is something different I think that a minimal reproduction is very much necessary here) |
It appears this behaves as expected, but as @dario-piotrowicz, it's not the clearest on how this works in the documentation. We have an issue open to track that documentation problem. If you still feel there is an issue, please re-open this issue or provide further details in a new issue. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 bug report
This ticket summarizes my findings to the issue described bellow.
I´m aware that there are similar reports already, but none of them quite fit my problem.
Affected Package
The issue is likely caused by package @angular/animations
Is this a regression?
Yes, the previous version in which this bug was not present was:
7.2.7
according to this comment:Downgrading didn´t fix it for me though.
Description
I´m trying to add and remove an element to the DOM using
*ngIf="someValue"
.I want to be able to play a fade-in animation using
[@animation]
when it get´s added to the DOM-tree.This works fine using
👍
According to https://angular.io/guide/animations this should work for
:leave
too.Sadly, it doesn´t. 👎
According to this old Stackoverflow post
❓ If that´s the case,
:leave
(* => void
) wouldn´t work at all?Am I missing something or is it a bug?
🔬 Minimal Reproduction
Will follow 🤷♀
🌍 Your Environment
Angular Version:
Anything else relevant?
Possibly related issues: #29509, #29496
The text was updated successfully, but these errors were encountered: