frontend-collective / frontend-collective/react-sortable-tree
canNodeHaveChildren not called if there is no row above.
- Dominant language
- JavaScript
- Stars
- 5k
- Forks
- 914
- PR merge metrics
- No merged PRs in 30d
Description
As far as I can gather, there is no way to prevent showing the hover preview if hovering over the first level of the tree, because canNodeHaveChildren is not called.
I can see in the source code:
````
if (rowAbove) {
var path = rowAbove.path;
var aboveNodeCannotHaveChildren = !this.treeRef.canNodeHaveChildren(rowAbove.node);
if (aboveNodeCannotHaveChildren) {
path = path.slice(0, path.length - 1);
} // Limit the length of the path to the deepest possible
dropTargetDepth = Math.min(path.length, dropTargetProps.path.length);
}
````
Where canNodeHaveChildren is only called if there is a row above.
So, my question is: is there a way to prevent the hover preview for the first level of the tree?
Thanks!

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.