Skip to content

bug(@react-stately/data): move in TreeData, doesn't update parentKey when moving to another parent #1987

@alirezamirian

Description

@alirezamirian

🐛 Bug Report

If a tree node is moved to another parent with move, parentKey is not updated, which leads to unexpected issues in the subsequent updates to the tree.

🤔 Expected Behavior

parentKey on the moved node should be updated to the key of the new parent.

💻 Code Sample

I didn't have time to provide a code sample, and it's such a tiny bug. I'm gonna create a PR soon with a test case and the fix. Let me know if a code sample is still needed.

🌍 Your Environment

Software Version(s)
react-stately 3.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions