-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Race conditions with existing animation runner (replace, templateUrl) #13215
Comments
If it worked before, it's most likely a regression. Thanks for reporting. |
This is due to a combination of replace and templateUrl on the directive. Replace is also deprecated, you should consider not using it. You could also use the template Property instead of templateUrl. However, I've noticed another bug: after the leave animation finishes, the element is still in the DOM until some timeout finishes. This happens only if an enter animation is still running. |
I have noticed that latter bug indeed. I am planning a 2.0.0 version of my lib without replace, not sure if that would fix it. About using So I am not asking Angular to workaround this for me. If this is something solved in userland, I will workaround myself, but I think it is still a regression. |
I think we should definitely fix the different behavior of templateUrl vs. template property, but as replace has been deprecated since 1.3?, it just means you shouldn't bet on this being fixed. |
You know what is the problem with I will rewrite my whole CSS to remove replace and for ui-bootstrap I will do what is needed for the 1.0.0 release that is close. Thanks @Narretz |
@Foxandxss sorry for this taking a few months to get resolved. Your best bet is to use We ran into this issue with transclusion as well and there was no proper solution. If your code is still relying on |
Can I use About replace, yes, I have to remove it. The CSS is inherited from the library I created the original rewrite and it is made for a concrete html structure that I cannot replicate without replace. So I need to rewrite the CSS which is another history. |
Any updates on this? I'm really sorry for the bump. |
This should probably be closed given that We encountered issues in UI Bootstrap as well I believe, but we're in the process of stripping out |
I agree that since |
Hello,
I have an issue that I am not really sure if it is something that ngAnimate should fix or it has to be managed in the end applications.
I am using
$animate.enter
to bring some DOM to the screen and then$animate.leave
to delete them (a popup message). Works good. The problem comes when you try to make them leave while they are running. The new ngAnimate (1.4.0+) has a new mechanism to cancel running animations, but it fails under some corner cases.Check this plunker (Angular 1.4.7)
Check this plunker (Angular 1.4.7, no ngAnimate)
Check this plunker (Angular 1.3.20, ngAnimate)
The close behavior in there is crappy, but reproduces my issue. My first impression is that even when
.leave
is called with a proper element, it gets deleted in the mean time so when it reaches ngAnimate, there is nothing to work with and it throws an exception.This is a poor reproduction of Foxandxss/angular-toastr#136
There is a plunker with the real issue. Also going back to 1.3.20 fixes it.
So, should I somehow prevent this? Or ngAnimate should be able to do this correctly? I want to think about the latter since it used to work.
Thank you.
The text was updated successfully, but these errors were encountered: