Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ZakRabe opened this issue Oct 10, 2020 · 3 comments · Fixed by #36
Closed
Assignees
Labels

Comments

@ZakRabe
Copy link

ZakRabe commented Oct 10, 2020

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.

@Lodin
Copy link
Owner

Lodin commented Oct 11, 2020

@ZakRabe, thanks, I consider it as a bug. Going to fix it ASAP.

@Lodin
Copy link
Owner

Lodin commented Oct 11, 2020

@ZakRabe, released in 2.0.3

@ZakRabe
Copy link
Author

ZakRabe commented Oct 11, 2020

Thanks very much for looking into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants