When the child's ID is smaller than the parent's ID, the child may not be associated properly.
The reason is that there is code that sorts by parent ID, then sorts by ID, and adds to the tree.
example
PR
I think you can solve this problem by sorting the list by the depth of the tree.
Problem
When the child's ID is smaller than the parent's ID, the child may not be associated properly. The reason is that there is code that sorts by parent ID, then sorts by ID, and adds to the tree.
example
PR
I think you can solve this problem by sorting the list by the depth of the tree.
Here is a suggestion: https://github.com/DenQ/list-to-tree/pull/26