react-vtree icon indicating copy to clipboard operation
react-vtree copied to clipboard

The expanded children nodes are expanded even when we collapsed at the parent level.

Open PoojaMgr opened this issue 3 years ago • 1 comments

Hi, I encountered one scenario -

  • Let's say we have four nested nodes. Expand the nodes one by one till the last nested children.

  • Now, collapse at the most top-level parent, it would get collapse. But when expanded again, all nested nodes were found in the same open state.

Once collapsed at the parent level, all the sub-nodes should also collapse every time.

isOpenByDefault: false/true didn't help on this as it just helps to maintain an initial state of all nodes (whether to keep all nodes as in expanded or collapse state)

PoojaMgr avatar Jul 06 '22 08:07 PoojaMgr

Each node has its own state. In order to collapse everything under a node you need to use recomputeTree which is accessible when using a ref.

gregjoeval avatar Aug 30 '22 14:08 gregjoeval