-
Notifications
You must be signed in to change notification settings - Fork 773
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] motionValue sometimes set to NaN via animate utility #1094
Comments
Here is a video |
NaN happens when the animate object has the https://codesandbox.io/s/animate-results-in-nan-forked-0xlq6?file=/src/App.tsx:405-426 |
Poking about in framer-motion source, I see my calls go to popmotion via motion/src/animation/utils/transitions.ts Line 198 in e8e7906
but grabbing some parameters which cause the bug and feeding them into popmotion directly does not cause onUpdate to go NaN: Not sure off the top of my head the next best path to debug this... |
Dug into popmotion a bit to trace this. It seems that sometimes when a derived Velocity is added to a settings object, tween updates return NaN. Here is a contrived example with a known errant velocity and duration: Here are my rough notes from tracing in popMotion:
Let me know if I should open a ticket in popmotion. Thank you for help in debuggng this. |
Thanks for the popmotion ticket! I'll close this one so it's just tracked in one place. |
Sometimes when resetting an animate on a motionValue, the motionValue becomes NaN.
In this codepen, click to reset the target of the animation a few times and the motion value becomes set to NaN.
https://codesandbox.io/s/animate-results-in-nan-um7ec?file=/src/App.tsx
The motion value should never be set to NaN.
The text was updated successfully, but these errors were encountered: