You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No animations when compiling with Angular CLI #1658
There is currently a repaint function in the animation file that may be being removed in your build. Can you check whether or not it is in your compiled code?
I think angulars build optimizer will remove unused properties, because it assumes that it has no side effects.
I assume that you are calling offsetWidth because you want to force a layout reflow?
Maybe you can use getClientRects() instead? It should force a reflow too, but i don't know if that method is slower.
Activity
owen-m1 commentedon Oct 9, 2019
There is currently a
repaintfunction in the animation file that may be being removed in your build. Can you check whether or not it is in your compiled code?DanielToft commentedon Oct 9, 2019
Hi @owen-m1
I can see that the repaint function is excluded and the call to repaint in the animate function is excluded too.
Here is the compiled animate function
DanielToft commentedon Oct 9, 2019
I think angulars build optimizer will remove unused properties, because it assumes that it has no side effects.
I assume that you are calling
offsetWidthbecause you want to force a layout reflow?Maybe you can use
getClientRects()instead? It should force a reflow too, but i don't know if that method is slower.owen-m1 commentedon Oct 10, 2019
@DanielToft Does calling that function instead cause the code to stay in the compiled build?
Also yes I think it would be slower.
denisr-w commentedon Apr 6, 2020
Still having issues with that.
Animation not working, when --prod flag enabled.
Not tree-shake repaint function by compressors like terser
amay077 commentedon Jul 31, 2020
Could you publish to NPM include this PR?
Not tree-shake repaint function by compressors like terser