Closed adammo94 closed 4 years ago
Hello @adammo94
That is intended behavior, during the animation height needs to have overflow: hidden
meaning that box shadow will be cut off. If you want to have shadows apply it to theAnimateHeight
element directly.
Check the example here: https://codesandbox.io/s/react-animate-height-basic-example-forked-3wl3g
Cheers!
Yes, but then what If I want many elements inside one container and want those elements to have separate shadows?
Unfortunately, this approach relies on overflow: hidden
. You can try the max-height
transitions but that approach has other issues.
So If I don't set any margins to div I want to animate height of, it won't show box-shadow correctly. Shadow(s) will appear only after animation is over. When I set margins it renders shadows correctly throughout the animation.
Simple example: https://codesandbox.io/s/react-animate-height-basic-example-forked-9vhwd