-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngRepeat leaves stale items when there is a css transition on the element and angular-animate is loaded #5376
Comments
Can you have a test with this patch? Here are the files: https://s3.amazonaws.com/angularjs-dev/ng-animate-ie-10/angular.js |
Thanks, the stale items now disappear but they still appear for a fraction of a second. |
Alright, so this next bug is because of this: #5262 |
Is the flicker only showing up with IE10? I don't see it in Chrome. |
Yep, its just IE10. |
OK I figured out what's going on. Your CSS transition declaration in invalidThe syntax for ease-in-out is only being understood by IE10, so to make it work with other browsers, have it in the format of PROPERTY DURATION EASE DELAY; -webkit-transition: color 0.08s ease-in-out;
transition: color 0.08s ease-in-out; Here's the cross-browser bug in action. That makes the flicker bug appear in Chrome and Firefox. Now to deal with the flicker bug.You have placed a transition on all To deal with the flicker you can either:
Here's a working example:
$animateProvider.classNameFilter(/animated/); Then your links won't flicker or animate at all unless you pass in a Here's the fix in action. |
For now there is no automatic way to see if the element will actually animate during a event that ngAnimate starts. If we know that a style has changed (during the first CSS class) or will change (during the second CSS class) then we know for sure that an animation will kick off and we can open the space for that animation to close. The only for sure way to find this out is to make a deep copy of the content returned from So var node = element[0]; //break out of jquery
var styles0 = angular.copy(window.getComputedStyle(node));
node.className += ' ng-enter';
var styles1 = angular.copy(window.getComputedStyle(node));
var isDifferent = !equals(styles0, styles1);
node.className += ' ng-enter-active';
isDifferent = isDifferent || !equals(styles1, styles2);
if(isDifferent) {
//do the animation
} This would 100% eliminate bugs like the link bug, but it would entirely cripple the browser. There is no way we can cache this since the CSS selector pointing to the CSS is unknown and it could change at any point (CSS classes on parent elements changing or media queries). So we can't do that for now. |
Closing this for now since there is no full fix, but if you use any of the two workarounds that I mentioned then you should be good. |
Hi,
I'm using angular 1.2.4 and noticed that ngRepeat leaves stale items when a there is a css transition on the repeated element in IE10. It only started happening after i included angular-animate.
and here's the fiddle...
http://jsfiddle.net/RR5Tp/3/
Browsers: IE 10
Operating system: Windows 8.1
The text was updated successfully, but these errors were encountered: