Open
Description
Provide a general summary of the issue here
The getItem()
function returns undefined for each child in the moved parent node within the root.
🤔 Expected Behavior?
The getItem()
function returns the child after moving the parent node.
😯 Current Behavior
getItem()
returns undefined
💁 Possible Solution
Add all removed children in nodeMap for the moved node in the moving function (probably here)
🔦 Context
No response
🖥️ Steps to Reproduce
const tree = useTreeData({
initialItems: [
{
id: 1,
children: [],
},
{
id: 2,
children: [],
},
{
id: 3,
children: [
{
id: 30,
children: [],
},
{
id: 31,
children: [],
},
],
},
],
getKey: (item) => item.id,
getChildren: (item) => item.items,
});
tree.getItem(31) // return node:31
tree.move(3, null, 0)
tree.getItem(31) // return undefined
Version
react-stately: 3.36.1
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
macOS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response