-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Element with ng-show=false animates initially when it's in a bootstrap-ui modal #8812
Comments
@Narretz did this by chance get fixed with RC0? |
Nope, unfortunately it still happens: http://plnkr.co/edit/RcWCCktlLYonooUXNOnZ?p=preview |
Looks like it's working to me: http://plnkr.co/edit/qPE3aAE6jJCvcvhtigZT?p=preview (wait, I might be wrong, hang on) |
Okay yeah so it does still animate :( But @Narretz the plunker you linked was broken and didn't really demonstrate that :p |
Thanks for checking @caitp |
@caitp can you please look into this? repro with rc3: http://plnkr.co/edit/103bF0Ve4ioXkdCRONaS?p=preview |
http://plnkr.co/edit/YCMZP41SnHLZke6sEeqy?p=preview I think this is basically the two cases we are looking at. so, in the case of doing this with jQuery/raw DOM operations, I don't think there is much we can do --- but we still see the issue with ngAnimate's enter/leave being used too. I think if @matsko can you explain this quickly? |
So matsko has said there are basically 2 options: bootstrap should be able to just disable animations on the modal, and then re-enable them shortly after (I tried to demonstrate this in my mini-repro, but I couldn't make it work --- it never re-enabled animations! but I was probably just doing it wrong). Alternatively, something about making Either of these seem like good solutions to this problem to me (well, moreso the first one if I can figure out how to make that work properly). |
@caitp any luck with making the first solution work? |
no, from what I've seen, re-enabling animations after disabling doesn't seem to have any effect on child elements |
I might be missing something, but I don't think ng-animate-children should be part of the problem here. ui-bootstrap uses a custom transition handling that uses the original bootstrap styles. |
This is still a problem on master. Moving to 1.4.x milestone. |
👍 same issue here. |
- how to enable / disable animations Closes angular#8812 - how to handle conflicts with existing animations Closes angular#8033 Closes angular#11820 - what happens on boostrap / how to enable animations on bootstrap
- how to enable / disable animations Closes angular#8812 - how to handle conflicts with existing animations Closes angular#8033 Closes angular#11820 - what happens on boostrap / how to enable animations on bootstrap
I believe this is not something that ngAnimate can be expected to solve. the bootstrap modal (at least in this version) doesn't use ngAnimate to trigger then moving / fading in of the modal, so ngAnimate has no chance to detect that there's an animation going on. If ngAnimate knew that there was an animation, it would not anmate stuff in the modal. I think in recent versions, the modal actually uses $animate, so this issue should be moot. Otherwise, the modal service could disable animations on the modal elements with $animate.enabled(el, false) until the opening animation has finished. |
This is a follow-up to #5262 It turns out that the issue I described is different from the original issue described. In my case, I have a ng-show animation inside a bootstrap-ui modal that is initially set to false. When the modal opens, however, the element is animated from shown to hidden, while it should simply be not shown. I have posted a workaround here: #5262 (comment)
The text was updated successfully, but these errors were encountered: