It is my understanding that Animation.cancel is supposed to remove any remaining fill effects of KeyframeEffects that where part of the animation even after it has finished.
I am animating page transition and use the fill property to avoid flicker during animation and need to clear the fill effects after the animation finished. Unfortunately it doesn't seem to work reliably in my scenario:
Following examples animate outgoing page from opacity: 1 to opacity: 0 while the incoming page is animated with a transform.
First example seems to work fine. Second is a bit more complex with 3 KeyframeEffects being used. After clicking "Next Page" 4 times you should see that both pages get stuck in opacity: 0 filling animation. So it appears that it does work in first 2 page transitions (1 -> 2 and 2->1) but stops after that for some reason.
As you can see I am detaching the outgoing page from dom after the animation - I wonder it this has anything to do with it. Please ignore the polymer bits and just look at _animateTransition methods. Thanks.
It is my understanding that
Animation.cancel
is supposed to remove any remainingfill
effects of KeyframeEffects that where part of the animation even after it has finished.I am animating page transition and use the fill property to avoid flicker during animation and need to clear the fill effects after the animation finished. Unfortunately it doesn't seem to work reliably in my scenario:
Following examples animate outgoing page from
opacity: 1
toopacity: 0
while the incoming page is animated with atransform
.http://jsbin.com/zeyajemuko/edit?html,output
http://jsbin.com/jobavopixo/edit?html,output
First example seems to work fine. Second is a bit more complex with 3 KeyframeEffects being used. After clicking "Next Page" 4 times you should see that both pages get stuck in
opacity: 0
filling animation. So it appears that it does work in first 2 page transitions (1 -> 2 and 2->1) but stops after that for some reason.As you can see I am detaching the outgoing page from dom after the animation - I wonder it this has anything to do with it. Please ignore the polymer bits and just look at
_animateTransition
methods. Thanks.