You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few css properties that appear to require a "double paint" at the browser rendering engine level — when the mutation observer gets fired, only 1 of the two has happened. There are some flex layouts and table layouts that also do the same thing. I'm sure what the solution is to these issues but open to suggestions.
Reacted by Matheus Lasserre, Mehdi, spookyuser and Itay Ganor
It would be amazing if someone would have a list of CSS properties / layout patterns that lead to double painting. I am encountering these jumps when using more complex objects / layouts and its a shame. Finding a fix or a workaround would be amazing!
Reacted by Robert-MVG, Alexander Rubtsov and Itay Ganor
Dug into this one properly 🔬 I sampled element positions every 200ms through a remove in flex + gap, grid + gap and wrapping flex: on current AutoAnimate (0.10.x) they all glide smoothly with no jumps, so the original gap case is fixed.
The jump that remains is items that stretch (flex: 1 / flex-grow). Removing a sibling makes every item wider (85px → 120px in my test). AutoAnimate does emit width keyframes, but flex: 1 sets flex-basis: 0%, so width is ignored and the items snap to their new size. That's the "double paint" feeling. Animating flex-basis instead doesn't save it: as items resize, the layout reflows every frame while FLIP transforms are computed against the final layout, so neighbours slide twice. Fixing that properly needs per-frame position correction (a much bigger change), so it isn't happening in a patch.
Workaround, now in the docs (#259): give items a fixed basis (flex: 0 0 120px) or use a grid with fixed tracks, and everything animates cleanly. Closing as fixed for gap, with the stretch limitation documented. If anyone has a layout with fixed-size items that still jumps, please post a repro! 🙏
Activity
justin-schroeder commentedon Aug 19, 2022
There are a few css properties that appear to require a "double paint" at the browser rendering engine level — when the mutation observer gets fired, only 1 of the two has happened. There are some flex layouts and table layouts that also do the same thing. I'm sure what the solution is to these issues but open to suggestions.
patrikzudel commentedon Apr 12, 2023
It would be amazing if someone would have a list of CSS properties / layout patterns that lead to double painting. I am encountering these jumps when using more complex objects / layouts and its a shame. Finding a fix or a workaround would be amazing!
clicktodev commentedon May 1, 2025
is there a theoretical solution to the double paint problem?
this kinda sucks, the library in unusable with flex and grid
justin-schroeder commentedon May 1, 2025
If you find a solution im all ears
clicktodev commentedon May 6, 2025
can you provide more info on the "double paint' behavior?
docs: note that stretching flex items (flex: 1) can't animate their r…
justin-schroeder commentedon Nov 22, 2026
Dug into this one properly 🔬 I sampled element positions every 200ms through a remove in flex +
gap, grid +gapand wrapping flex: on current AutoAnimate (0.10.x) they all glide smoothly with no jumps, so the originalgapcase is fixed.The jump that remains is items that stretch (
flex: 1/flex-grow). Removing a sibling makes every item wider (85px → 120px in my test). AutoAnimate does emit width keyframes, butflex: 1setsflex-basis: 0%, sowidthis ignored and the items snap to their new size. That's the "double paint" feeling. Animatingflex-basisinstead doesn't save it: as items resize, the layout reflows every frame while FLIP transforms are computed against the final layout, so neighbours slide twice. Fixing that properly needs per-frame position correction (a much bigger change), so it isn't happening in a patch.Workaround, now in the docs (#259): give items a fixed basis (
flex: 0 0 120px) or use a grid with fixed tracks, and everything animates cleanly. Closing as fixed forgap, with the stretch limitation documented. If anyone has a layout with fixed-size items that still jumps, please post a repro! 🙏