web-animations/web-animations-js

Finish/Destroy a Infinity animation

jdnichollsc opened this issue · 4 comments

Hello guys!
I was wondering if is possible to finish/destroy an animation with iterations equal to Infinity

Thanks in advance!

If the target effect end is infinity, it's supposed to throw an Invalid State Error, per step 1 in the algorithm for finishing an animation:
https://www.w3.org/TR/web-animations-1/#finishing-an-animation-section

target effect end:

The target effect end of an animation is equal to the end time of the animation’s target effect.

An end in infinity is not finishable.

So is cancel the right way to do that?

Yep, cancel is the right method to get rid off the animation.

Thanks for your help and for your time, it's working as expected now https://proyecto26.com/animatable-component/