Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Setting the speed value of the new animate feature to -1 does not reverse play. #2060

Closed
sukjae opened this issue Mar 31, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@sukjae
Copy link

sukjae commented Mar 31, 2023

1. Describe the bug

Setting the speed value of the new animate feature to -1 does not reverse play as mentioned in the document.
image
https://www.framer.com/motion/animate-function/###speed

2. IMPORTANT: Provide a CodeSandbox reproduction of the bug

https://codesandbox.io/s/great-cherry-pxgogh?file=/src/App.js:1073-1219

3. Steps to reproduce

  1. open codesandbox
  2. click play button on reverse section (This is the bottom example.)

5. Expected behavior

A clear and concise description of what you expected to happen.

const animation = animate(".four", { x: [0, 100] });
animation.speed = -1;

I expected to start at 100 and end at 0 and then stay fixed at 0.

However, only a slight shaking occurs at the moment, but it does not work.

@sukjae sukjae added the bug Something isn't working label Mar 31, 2023
@mattgperry
Copy link
Collaborator

It will play from its current position. So you'd first need to set

animation.time = animation.duration

@sukjae
Copy link
Author

sukjae commented Apr 10, 2023

It will play from its current position. So you'd first need to set

animation.time = animation.duration

Unfortunately, it still doesn't work. Will this PR solve the problem by any chance? @mattgperry 🙏

#2068

Sample Code: https://codesandbox.io/s/thirsty-firefly-d0zv50?file=/src/App.js

@mattgperry
Copy link
Collaborator

Yeah I believe so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants