motiondivision / motion

A modern animation library for React and JavaScript
https://motion.dev
MIT License
25.66k stars 842 forks source link

[BUG] elements being jelly/jumping when moving while scrolling #2885

Open a-dominiak opened 6 days ago

a-dominiak commented 6 days ago

2. Describe the bug

Folders on screen bottom are being animated while they shouldn't

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

https://codesandbox.io/p/devbox/vite-react-forked-8dpfhm?file=%2Fsrc%2Ffolders.tsx%3A15%2C11&workspaceId=8f48a2a0-ca3e-4718-85cd-d6a6718ca0c1

4. Steps to reproduce

Start scrolling back and forth. I disabled lenis smooth-scroll, so while the animation is jittery when using mouse wheel, the bottom folders shouldn't "jump".

Steps to reproduce the behavior:

  1. Scroll back and forth

5. Expected behavior

The bottom folders shouldn't jump at all, they should stay in place

6. Video or screenshots

https://github.com/user-attachments/assets/51b6d46c-bd39-44dc-8127-7ca5c8404e03

7. Environment details

Happens in every browser