We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 947b003 commit e451e40Copy full SHA for e451e40
src/utils/tree-data-utils.js
@@ -610,7 +610,8 @@ function addNodeAtDepthAndIndex({
610
}
611
612
// If the current position is the only possible place to add, add it
613
- if (currentIndex >= minimumTreeIndex - 1 || (isLastChild && !node.children)) {
+ if (currentIndex >= minimumTreeIndex - 1
614
+ || (isLastChild && !(node.children && node.children.length))) {
615
if (typeof node.children === 'function') {
616
throw new Error('Cannot add to children defined by a function');
617
} else {
0 commit comments