[BUG] Animation with css grid layout is squashing content and not synced properly
See original GitHub issueDescription
I’m trying to build an animatable layout with css grid and framer motion, basically show and hide sidebar with subtle animation.
The issue is with orchestrating animation using layout
prop and AnimatedSharedLayout
when the animation happens the content container animates later, and squeezes its children elements
I’m not sure if I’m doing something wrong here, but please go ahead and have a look yourself…
https://codesandbox.io/s/framer-motion-css-grid-layout-4x0ug?file=/src/App.tsx
How to reproduce
- Go to CodeSandBox
- Click on ‘Show Sidebar’
- Notice the sidebar and content animation
- Notice the ‘Show Sidebar’ button when animating
Expected behaviour
Smooth, clear, synced animation 😃
https://user-images.githubusercontent.com/6163988/108196218-22638280-7119-11eb-8de2-a4c989f35234.mov
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
CSS Grid Gotchas And Stumbling Blocks - Smashing Magazine
The first layout uses flexbox to display as many boxes as will fit into the available width. Here we are controlling the layout...
Read more >Preventing a Grid Blowout | CSS-Tricks
In our simple demo, the <main> element automatically places itself in that first column as it is the first child of the grid....
Read more >759665 - [css-grid] Support transitions/animations ... - Monorail
Is there any plans to get it working for grid-template-columns and grid-template-rows as defined in the spec? It seems to work for grid-gap...
Read more >CSS Grid Layout and progressive enhancement
Support for all the properties and values detailed in these guides is interoperable across browsers. This means that if you write some Grid...
Read more >Changelog - Bricks Builder
Documentation: https://academy.bricksbuilder.io/article/css-grid-layout/. Note: While the grid ... Infinite Scroll: Not working properly on blog/archivesFix ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You could try adding a wrapper between the motion with layout and the children with a motion.div with layout=“position”?
Thanks for helping 👍