Skip to content
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] Layout animations: bouncing occurs when duration is set, and the child size changes #3028

Open
oosawy opened this issue Jan 26, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@oosawy
Copy link

oosawy commented Jan 26, 2025

1. Read the FAQs 👇

2. Describe the bug

Just adding transition={{ duration: 1 }} to the scale correction example (using motion@latest) in layout animations causes strange bouncing.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

https://codesandbox.io/p/sandbox/jsq3ft?file=%2Fsrc%2FApp.js%3A16%2C35

4. Steps to reproduce

Steps to reproduce the behavior:

  1. Click on the box
  2. See the circle bouncing

5. Expected behavior

The circle does morphing and dosen't move unpredictably.

6. Video or screenshots

20250126-2056-52.8655039.mp4

7. Environment details

Chrome 131, Windows 11

@oosawy oosawy added the bug Something isn't working label Jan 26, 2025
@mattgperry
Copy link
Collaborator

Can you make this sandbox public?

@oosawy
Copy link
Author

oosawy commented Jan 27, 2025

@mattgperry
I don't think it's private by default, it should be fine now.

@mattgperry
Copy link
Collaborator

I'll have a think about what to do about this. Obviously it's not what you'd want in this instance - however what's technically happening is the child animating relative to its parent. This fixes a lot more bugs than it creates. Because the child is animating faster than the parent and that the child ends at the same place it starts it looks odd here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants