An option to keep the node (not return null) when the height is zero
sompylasar opened this issue · 6 comments
sompylasar commented
This is required when applying CSS transitions (e.g. for background color).
When unmounted (null
returned from render
), the node loses its CSS state so when re-mounted, it gets fresh CSS state, and the transitions start over.
nkbt commented
I reckon that makes sense. Keen to PR?
nkbt commented
nkbt commented
Published as 1.6.0 https://github.com/nkbt/react-collapse/releases/tag/v1.6.0
sompylasar commented
@nkbt Yay that's perfect! Thanks!
nkbt commented
Cheers! I had a fair amount of pain with this, but everything is solved now
as far as I can test it. Check out the demo on gh-pages to see it in action
:)
KyleAMathews commented
Just a thought — any reason not to default this to true? Using this module for a client project (w/ Gatsby) and I noticed that before enabling this, there was some noticeable jumping in the animation right around when I assume the element was being destroyed. After I enabled this, the animation became super smooth.