frontend-collective / frontend-collective/react-sortable-tree

rootKey in getTreeFromFlatData not behaving correctly for string based keys

Open
#286 4 comments 0 reactions 0 assignees View on GitHub
investigate possible bug (need more info)
Dominant language
JavaScript
Stars
5k
Forks
914
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.