motion icon indicating copy to clipboard operation
motion copied to clipboard

[BUG] Fix `repeat` options in `AnimationSequence`

Open thevinter opened this issue 1 year ago • 1 comments

Description:

While passing an array of animate definitions to animate() certain transition types (such as repeat) are completely ignored

CodeSandbox reproduction of the bug:

https://codesandbox.io/p/devbox/dyl4hm

Steps to reproduce

Open the codesandbox and refresh the main page

Expected behavior

Since both animate() calls operate on the same animation I would expect both squares to behave identically

thevinter avatar Nov 29 '24 03:11 thevinter

There's a fundamental technical difference here in that the normal repeat options apply to the animation as a whole.

animate(sequence, { repeat: 6, repeatType: "mirror" })

Whereas the sequence generates keyframes to then pass to an animation. Not that the user should know or care about this. But highlights, for instance, how repeat: Infinity would be impossible. And that there could be overhead adding support for these. So what I'll do is take a look into adding support (perhaps for a finite number of repeats) and see how much overhead it produces.

mattgperry avatar Dec 13 '24 14:12 mattgperry