-
-
Notifications
You must be signed in to change notification settings - Fork 994
Description
1. Read the FAQs 👇
2. Describe the bug
On a windows PC running at around 240hz refresh rate, the follow spring demo here:
https://examples.motion.dev/react/follow-pointer-with-spring?utm_source=homepage-header
is quite laggy anytime the mouse moves. I've made a video of it here:
I took a JS profile of it which I've also attached:
(it doesn't look like the JS thread is locking up, there's ample time between frames)
It very much feels like the spring stopped and restarted during this mouse movement, instead of the forces applying dynamically as the position of the mouse changes.
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
https://examples.motion.dev/react/follow-pointer-with-spring?utm_source=homepage-header
4. Steps to reproduce
Steps to reproduce the behavior:
- Go to https://examples.motion.dev/react/follow-pointer-with-spring?utm_source=homepage-header
- Be on a 240hz monitor
- Move mouse rapidly
- Notice spring animation is laggy until the mouse stops moving
5. Expected behavior
Pink circle should follow the mouse around at the constant spring rate that it does on a 60hz (or probably 120hz) monitor
6. Video or screenshots
https://www.youtube.com/watch?v=hQgduxVwtFM
7. Environment details
Windows 11, Chrome 137.0.7151.104