Skip to content

Changing the tree whilst having set initialOpen causes the tree to reset #238

@MetalMichael

Description

@MetalMichael

Describe the bug
Using a tree with the initialOpen, and changing any of the values within the tree causes the whole tree to reset and revert to the initial state.

To Reproduce
Steps to reproduce the behavior:

  1. Set initialOpen = [1]
  2. Expand one of the other tree nodes
  3. Modify any of the tree nodes
  4. See that the tree collapses

Expected behavior
Initial open should only be set on the initial render of the tree. Modifying the tree should not cause it to reset

Screenshots
Demo is here: https://stackblitz.com/edit/vitejs-vite-tby7yrjy?file=src%2Fcomponents%2FCanvas.tsx,src%2Fmain.tsx&terminal=dev
Reused from something else I was working on, but does the trick.

Desktop:

  • OS: MacOS
  • Browser: Chrome
  • Version: 136.0.7103.93

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions