-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
2. Describe the bug
After animating an element with "animate," I noticed that using the stop() function changes the component again after executing stop(). I think this is wrong, also because stop is not asynchronous.
the problem is that there is no way to understand when the animation is actually stopped (same thing goes for complete() )
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
https://codesandbox.io/p/sandbox/t254cq
You can test this with the following code:
import { animate } from "motion";
let proxy = new Proxy(
{ rotation: 0 },
{
set: (target, p, newValue) => {
console.log("edit");
if (p === "rotation") {
target[p] = newValue;
}
return true;
},
}
);
const a = animate(
proxy,
{
rotation: 1,
},
{ duration: 10, repeat: Infinity, repeatType: "loop", ease: "linear" }
);
// new timeout
setTimeout(() => {
a.stop();
console.log("stop");
}, 100);
return a;4. Steps to reproduce
Steps to reproduce the behavior:
- Click the button
- See the console
5. Expected behavior
after stop there should be no other logs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working