react-dnd-treeview icon indicating copy to clipboard operation
react-dnd-treeview copied to clipboard

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

Open MetalMichael opened this issue 10 months ago • 0 comments

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

MetalMichael avatar Jun 03 '25 23:06 MetalMichael