react-dnd-treeview
react-dnd-treeview copied to clipboard
Changing the tree whilst having set initialOpen causes the tree to reset
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:
- Set initialOpen = [1]
- Expand one of the other tree nodes
- Modify any of the tree nodes
- 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