Skip to content

not rendering according to the sorting order of the data #242

@william-jansen-itera

Description

@william-jansen-itera

Describe the bug
In the below data example, the "Backend" node appears before the "Frontend" node in the tree, so nodes are not sorted like in the array passed to the tree.

To Reproduce
Steps to reproduce the behavior:
use this data:
[
{ "id": 1, "parent": null, "text": "Projects", "droppable": 1, "sort_order": 0, "path": "0", "depth": 0 },
{ "id": 3, "parent": 1, "text": "Frontend", "droppable": 1, "sort_order": 0, "path": "0-0", "depth": 1 },
{ "id": 8, "parent": 3, "text": "index.js", "droppable": 0, "sort_order": 0, "path": "0-0-0", "depth": 2 },
{ "id": 9, "parent": 3, "text": "App.js", "droppable": 0, "sort_order": 1, "path": "0-0-1", "depth": 2 },
{ "id": 4, "parent": 1, "text": "Backend", "droppable": 1, "sort_order": 1, "path": "0-1", "depth": 1 },
{ "id": 10, "parent": 4, "text": "api.js", "droppable": 0, "sort_order": 0, "path": "0-1-0", "depth": 2 },
{ "id": 11, "parent": 4, "text": "db.js", "droppable": 0, "sort_order": 1, "path": "0-1-1", "depth": 2 },
{ "id": 14, "parent": 4, "text": "helper.js", "droppable": 0, "sort_order": 2, "path": "0-1-2", "depth": 2 },
{ "id": 5, "parent": 1, "text": "Docs", "droppable": 1, "sort_order": 2, "path": "0-2", "depth": 1 },
{ "id": 12, "parent": 5, "text": "README.md", "droppable": 0, "sort_order": 0, "path": "0-2-0", "depth": 2 },
{ "id": 13, "parent": 5, "text": "CONTRIBUTING.md", "droppable": 0, "sort_order": 1, "path": "0-2-1", "depth": 2 }
]

Expected behavior
the "Frontend" node appears before the "Backend" node.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions