motiondivision / motionone

https://motion.dev
MIT License
2.84k stars 52 forks source link

[Bug] Presence and Rerun not calling initial animation on each change (only exit) #213

Open Lastofthefirst opened 1 year ago

Lastofthefirst commented 1 year ago

1. Describe the bug

I'm trying to animators Ology yes, in between content changes using presents and rerun. When the animation duration is longer, the initial information seems to get skipped, and only the exit animation is played. In the example below, I put two of these type of animations next to each other, one slower, and one faster, you'll notice that the slower one only plays the initial animation on the first appearance, and does not after.

2. IMPORTANT: Provide a CodeSandbox reproduction of the bug

https://codesandbox.io/s/elegant-darkness-z2rkrr?file=/src/index.jsx

3. Steps to reproduce

Steps to reproduce the behavior:

  1. Go to the codesandbox linked here: https://codesandbox.io/s/elegant-darkness-z2rkrr?file=/src/index.jsx
  2. Click on note the animation playing in a cycle.
  3. observe that the bottom animation does not play its initial animation after the first appearance, but the top one does.
  4. adjust animation durations to see the effect.
  5. try clicking the next button to see that it seems to happen even without the setInterval()

4. Expected behavior

I expect a slower animation to play the initial animation, but slower.

5. Video or screenshots

https://github.com/motiondivision/motionone/assets/47003973/59c2c5bd-7a9c-4aa4-bc10-648ef74a272d

6. Browser details

I tested it in the latest firefox and chromium.