Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

stagger animation not working in minified script #7547

Closed
aocenas opened this issue May 22, 2014 · 14 comments
Closed

stagger animation not working in minified script #7547

aocenas opened this issue May 22, 2014 · 14 comments

Comments

@aocenas
Copy link

aocenas commented May 22, 2014

working example:
http://embed.plnkr.co/LTUm8soHhnodBwpCqbNa/preview

not working:
http://embed.plnkr.co/wL8iIF5K55R9gOY1pHVm/preview

the only difference is using minified version of angular-animation from google cdn. In not working example the enter animation is triggered only for first element and then all other are inserted immediately, without animation.

It seems this issue was fixed in 1.2.13 for non minified version but in minified version it is still present.

tested in chrome 34.0.1847.137 and firefox 29.0.1 with angular v1.2.16

@jxhn
Copy link

jxhn commented May 22, 2014

Just an FYI, both those links work in IE11.

@IgorMinar IgorMinar added this to the 1.3.0 milestone May 22, 2014
@IgorMinar
Copy link
Contributor

I was able to repro this on chrome. cc: @matsko

@matsko
Copy link
Contributor

matsko commented May 22, 2014

Yeah it looks like only the first element is being animated. I'm checking it out. Thanks for finding this.

@matsko
Copy link
Contributor

matsko commented May 24, 2014

Interestingly enough it breaks on the preview mode, but not inside of the edit mode.

@matsko
Copy link
Contributor

matsko commented May 24, 2014

This may have something to do with the initial animation block that occurs upon bootstrap. But I still have no progress as to why the minified version isn't working.

@matsko
Copy link
Contributor

matsko commented May 30, 2014

This is strange, I'm only able to see the bug on plunkr. Locally with the same code and using a minified build. I even tried referencing the application via localhost in plunkr and it works fine.

My guess is that the animations are blocked upon bootstrap but since a minified file takes less time to download then somehow that effects when they're run? Although this wouldn't make sense locally.

Does anyone have any other examples of this happening?

@Narretz
Copy link
Contributor

Narretz commented Jun 4, 2014

I have made a similar observation (1.2.16); unfortunately I can only reproduce it on a Chromecast.
It's an image slideshow that is implemented with ng-repeat. Say I have 3 items in it; all are in the DOM, but only item 0 is displayed (inside the repeat are elements with ng-show). For transitions, I toggle ng-show on two elements. Minified, only the hide animation will fire, not the show animation. Unminfied both work. I can make a plunkr if you want. Problem is, it's only visible on a Chromecast.

@caitp
Copy link
Contributor

caitp commented Jun 4, 2014

Just testing real quickly with strict-di mode, it looks like there is some minification-unsafe code in ngAnimate, which could be related.

@caitp
Copy link
Contributor

caitp commented Jun 4, 2014

Hmm, maybe not, actually

@caitp
Copy link
Contributor

caitp commented Jun 4, 2014

Yeah, if it is related to code being minification unsafe, then we're probably missing a test--- and that's probably the thing which should be causing issues for minified code but not other code

@matsko
Copy link
Contributor

matsko commented Jul 1, 2014

I'm still having a tough time reproducing this locally without plunkr using a minified script. Has anyone had any luck doing so?

matsko added a commit to matsko/angular.js that referenced this issue Aug 16, 2014
…mations

When transition-delay and animation-delay were used to drive the staggering
animation the result was unpredictable at times due to the browser not being
able to register the generated delay styles in time. This caused a hard to
track down bug that didn't have a solid solution when styles were being used.

This fix ensures that stagger delays are handled by the $timeout service.

Closes angular#7547
Closes angular#7228

BREAKING CHANGE

If any stagger code consisted of having BOTH transition staggers and delay staggers
together then that will not work the same way. Angular will no instead choose
the highest stagger delay value and set the timeout to wait for that before
applying the active CSS class.
matsko added a commit to matsko/angular.js that referenced this issue Aug 16, 2014
…mations

When transition-delay and animation-delay were used to drive the staggering
animation the result was unpredictable at times due to the browser not being
able to register the generated delay styles in time. This caused a hard to
track down bug that didn't have a solid solution when styles were being used.

This fix ensures that stagger delays are handled by the $timeout service.

Closes angular#7547
Closes angular#7228

BREAKING CHANGE

If any stagger code consisted of having BOTH transition staggers and delay staggers
together then that will not work the same way. Angular will no instead choose
the highest stagger delay value and set the timeout to wait for that before
applying the active CSS class.
matsko added a commit to matsko/angular.js that referenced this issue Aug 16, 2014
…mations

When transition-delay and animation-delay were used to drive the staggering
animation the result was unpredictable at times due to the browser not being
able to register the generated delay styles in time. This caused a hard to
track down bug that didn't have a solid solution when styles were being used.

This fix ensures that stagger delays are handled by the $timeout service.

Closes angular#7547
Closes angular#7228

BREAKING CHANGE

If any stagger code consisted of having BOTH transition staggers and delay staggers
together then that will not work the same way. Angular will no instead choose
the highest stagger delay value and set the timeout to wait for that before
applying the active CSS class.
@matsko
Copy link
Contributor

matsko commented Aug 16, 2014

matsko added a commit to matsko/angular.js that referenced this issue Aug 16, 2014
…mations

When transition-delay and animation-delay were used to drive the staggering
animation the result was unpredictable at times due to the browser not being
able to register the generated delay styles in time. This caused a hard to
track down bug that didn't have a solid solution when styles were being used.

This fix ensures that stagger delays are handled by the $timeout service.

Closes angular#7547
Closes angular#7228
Closes angular#8547

BREAKING CHANGE

If any stagger code consisted of having BOTH transition staggers and delay staggers
together then that will not work the same way. Angular will no instead choose
the highest stagger delay value and set the timeout to wait for that before
applying the active CSS class.
matsko added a commit to matsko/angular.js that referenced this issue Aug 16, 2014
…mations

When transition-delay and animation-delay were used to drive the staggering
animation the result was unpredictable at times due to the browser not being
able to register the generated delay styles in time. This caused a hard to
track down bug that didn't have a solid solution when styles were being used.

This fix ensures that stagger delays are handled by the $timeout service.

Closes angular#7228
Closes angular#7547
Closes angular#8297
Closes angular#8547

BREAKING CHANGE

If any stagger code consisted of having BOTH transition staggers and delay staggers
together then that will not work the same way. Angular will no instead choose
the highest stagger delay value and set the timeout to wait for that before
applying the active CSS class.
matsko added a commit to matsko/angular.js that referenced this issue Aug 16, 2014
…mations

When transition-delay and animation-delay were used to drive the staggering
animation the result was unpredictable at times due to the browser not being
able to register the generated delay styles in time. This caused a hard to
track down bug that didn't have a solid solution when styles were being used.

This fix ensures that stagger delays are handled by the $timeout service.

Closes angular#7228
Closes angular#7547
Closes angular#8297
Closes angular#8547

BREAKING CHANGE

If any stagger code consisted of having BOTH transition staggers and delay staggers
together then that will not work the same way. Angular will no instead choose
the highest stagger delay value and set the timeout to wait for that before
applying the active CSS class.
matsko added a commit to matsko/angular.js that referenced this issue Aug 19, 2014
…mations

When transition-delay and animation-delay were used to drive the staggering
animation the result was unpredictable at times due to the browser not being
able to register the generated delay styles in time. This caused a hard to
track down bug that didn't have a solid solution when styles were being used.

This fix ensures that stagger delays are handled by the $timeout service.

Closes angular#7228
Closes angular#7547
Closes angular#8297
Closes angular#8547

BREAKING CHANGE

If any stagger code consisted of having BOTH transition staggers and delay staggers
together then that will not work the same way. Angular will no instead choose
the highest stagger delay value and set the timeout to wait for that before
applying the active CSS class.
@aocenas
Copy link
Author

aocenas commented Aug 20, 2014

@matsko thanks, great work.
If you do not mind and just out of curiosity, do you know why this issue was consistently in effect only when using the minified version? From what I understood from the commit diff and the comment this was more of timing issue of the animation/transition delay and so I would expect more random results when testing no matter if using minified source or not.

@btford btford removed the gh: issue label Aug 20, 2014
matsko added a commit to matsko/angular.js that referenced this issue Aug 25, 2014
…mations

When transition-delay and animation-delay were used to drive the staggering
animation the result was unpredictable at times due to the browser not being
able to register the generated delay styles in time. This caused a hard to
track down bug that didn't have a solid solution when styles were being used.

This fix ensures that stagger delays are handled by the $timeout service.

Closes angular#7228
Closes angular#7547
Closes angular#8297
Closes angular#8547

BREAKING CHANGE

If any stagger code consisted of having BOTH transition staggers and delay staggers
together then that will not work the same way. Angular will no instead choose
the highest stagger delay value and set the timeout to wait for that before
applying the active CSS class.
matsko added a commit to matsko/angular.js that referenced this issue Aug 26, 2014
…mations

When transition-delay and animation-delay were used to drive the staggering
animation the result was unpredictable at times due to the browser not being
able to register the generated delay styles in time. This caused a hard to
track down bug that didn't have a solid solution when styles were being used.

This fix ensures that stagger delays are handled by the $timeout service.

Closes angular#7228
Closes angular#7547
Closes angular#8297
Closes angular#8547

BREAKING CHANGE

If any stagger code consisted of having BOTH transition staggers and delay staggers
together then that will not work the same way. Angular will now instead choose
the highest stagger delay value and set the timeout to wait for that before
applying the active CSS class.
@matsko matsko closed this as completed in 23da614 Aug 26, 2014
@matsko
Copy link
Contributor

matsko commented Apr 1, 2015

The issue is repainting. Using $timeout ensures that there is a repaint in between stagger steps. This issue however just popped up for a more special case and the solution was to not have a particular line of code be removed by the minifier: #11469.

Long story short, this should be fully working now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.