react-complex-tree
react-complex-tree copied to clipboard
Animation when node is opened and closed
Is it possible to add a custom animation to the node content when its opened and closed?
Opening transitions should be doable fairly easily, when a subtree is opened, its content is rendered in and you should be able to just add an animation to that with CSS.
Closing animations are probably quite a bit trickier, I'm not sure if that is possible since the subtree is directly unloaded when you close the subtree, so a CSS animation is probably not working then.
Is there any quick example for the animation? I think it would help a lot to implement in tree open/close folders.
Since this came up in another issue, I've added a prop shouldRenderChildren
to allow library consumers to also show a subtree content when it is already collapsed, to allow for rendering a collapse animation. Alongside that, I also implemented a sample implementation for expanding and collapsing animations. See Demo
and Demo Implementation for details.