Skip to content

Toggling OpennessState of Items with different nestingLevels must be done sequentially #35

@ZakRabe

Description

@ZakRabe

In my project I am attempting to open all parent nodes to reveal a target node. In my initial approach I reduced an array of node IDs into an object to pass to recomputeTree. I found this never worked, and I must recompute the tree multiple times in order of nesting level to successfully expand all the nodes in my array.

Here is a link to a sandbox example.
https://codesandbox.io/s/cold-field-7q3kr?file=/src/Tree.tsx

Notice the first node in my list of target IDs to expand does correctly open, but not the second target ID.
I've included a block of code that is commented out, that does successfully open all the nodes listed in the array of IDs, but I didn't expect this to be needed, and it calls recomputeTree once for every ID in the list.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions