Skip to content

rootKey in getTreeFromFlatData not behaving correctly for string based keys #286

Open
@adeperio

Description

@adeperio

Hi, think I've found a bug,

When trying to use the getTreeFromFlat data function, and:

  1. Your id's are global strings
  2. Your tree doesn't have a rootKey

The function keeps returning back an empty array []

I think this is a bug in the function in the following code block
https://github.com/fritz-c/react-sortable-tree/blob/337a633e75a761f6a10bdf9ea0e2d06d82e603b9/src/utils/tree-data-utils.js#L993

I think this shouldn't return an empty array if no rootKey is give.

I've also tried setting it to '0' as per #189 but that's not helping either.

Any ideas what else it could be?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions