framer / motion

Open source, production-ready animation and gesture library for React
https://framer.com/motion
MIT License
23.57k stars 792 forks source link

Slow spring animation is cut off after a while #1207

Open rijk opened 3 years ago

rijk commented 3 years ago

CodeSandbox reproduction of the bug https://codesandbox.io/s/framer-motion-border-radius-layout-issue-forked-s4ymf?file=/src/Modal.tsx

Steps to reproduce I am not 100% sure, but this does not seem like a smooth transition to me. Of course it could be because the config values are just too extreme, but it could also be a bug. This is the transition config:

const transition: Transition = {
  type: "spring",
  stiffness: 4,
  damping: 35,
  mass: 0.5
};
  1. Click one of the blue squares
  2. Midway during the animation, it suddenly accelerates to snap to the end

Expected behavior

The transition should keep an even pace until the end.

Video or screenshots

https://user-images.githubusercontent.com/159500/124361203-260e2680-dc2e-11eb-9cd1-05f5ef7fafea.mov

https://user-images.githubusercontent.com/159500/124361207-2ad2da80-dc2e-11eb-9511-2db4ff4f8523.mov

rijk commented 3 years ago

Still not working on 5.0.0-rc.1:

https://user-images.githubusercontent.com/159500/138563950-f39d5f62-c7c0-413b-8e09-05578d4d2696.mov