Skip to content

Commit 2977d3c

Browse files
committed
fix(ngAnimate): fix regression with animations on translate properties
1.2.0rc1 induced a fix that prevented animations from running twice, but this had the unintended consequence of causing animations on translate, translateX, and translateY to sometimes not run. This fix checks for those cases and only applies the work-around when appropriate. Closes angular#3933
1 parent 5eb1fb6 commit 2977d3c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/ngAnimate/animate.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ angular.module('ngAnimate', ['ng'])
203203
var rootAnimateState = {running:true};
204204
$provide.decorator('$animate', ['$delegate', '$injector', '$sniffer', '$rootElement', '$timeout', '$rootScope',
205205
function($delegate, $injector, $sniffer, $rootElement, $timeout, $rootScope) {
206-
206+
207207
$rootElement.data(NG_ANIMATE_STATE, rootAnimateState);
208208

209209
function lookup(name) {
@@ -618,9 +618,12 @@ angular.module('ngAnimate', ['ng'])
618618
var node = element[0];
619619

620620
//temporarily disable the transition so that the enter styles
621-
//don't animate twice (this is here to avoid a bug in Chrome/FF).
622-
node.style[w3cTransitionProp + propertyKey] = 'none';
623-
node.style[vendorTransitionProp + propertyKey] = 'none';
621+
//that are not translations don't animate twice
622+
//(this is here to avoid a bug in Chrome/FF).
623+
if (propertyKey.indexOf('translate') === -1) {
624+
node.style[w3cTransitionProp + propertyKey] = 'none';
625+
node.style[vendorTransitionProp + propertyKey] = 'none';
626+
}
624627

625628
var activeClassName = '';
626629
forEach(className.split(' '), function(klass, i) {

0 commit comments

Comments
 (0)