-
Notifications
You must be signed in to change notification settings - Fork 27.5k
1.2-rc2 breaks animation steps in example #4265
Comments
Yeah, there is actually a difference in the className change behavior on
However ... if you move the |
@malixsys the new behaviour is expected. Basically if you call addClass() and then removeClass() right after (or vice-versa) then it will cancel the former animation when the new animation takes place. With RC1 $animate was using timeouts to manage the animation boundaries and that's why the remove class happened just after the addClass was called (instead of right before). This isn't the case anymore with RC3+ since it doesn't use timeouts anymore. In this case you wold just remove the former CSS class once the addClass animation has done it's thing. var remove = 'step-' + currentStep;
currentStep = currentStep == 0 ? 1 : 0;
var add = 'step-' + currentStep;
$animate.addClass(element, add, function() {
element.removeClass(element); //no $animate, just element
}); This works, but there is a 1ms flicker at the end of the animation when the class is removed. Which is small bug with the $animate callbacks. I will work on a fix for that. |
@sod the RC2 code you have in your example is cancelling out the animation since the base CSS class already has transitions on it. By the time |
Take your time. Your work on ng-animate is amazing :) |
…dom operation occurs Transitions are blocked when the base CSS class is added at the start of the animation. This causes an issue if the followup CSS class contains animatable-styles. Now, once the animation active state is triggered (when the animation CSS dom operation occurs) the animation itself will always trigger an animate without a quick jump. Closes angular#5014 Closes angular#4265
…dom operation occurs Transitions are blocked when the base CSS class is added at the start of the animation. This causes an issue if the followup CSS class contains animatable-styles. Now, once the animation active state is triggered (when the animation CSS dom operation occurs) the animation itself will always trigger an animate without a quick jump. Closes angular#5014 Closes angular#4265
…dom operation occurs Transitions are blocked when the base CSS class is added at the start of the animation. This causes an issue if the followup CSS class contains animatable-styles. Now, once the animation active state is triggered (when the animation CSS dom operation occurs) the animation itself will always trigger an animate without a quick jump. Closes angular#5014 Closes angular#4265
Animation restarts from scratch in
http://plnkr.co/edit/JX3qUkMqp7AdVeeXAj9r?p=preview
works properly in
http://plnkr.co/edit/oqIWoYimcYAArRMCKo4V?p=preview
The text was updated successfully, but these errors were encountered: