diff --git a/src/utils/tree-data-utils.js b/src/utils/tree-data-utils.js index 09cb4dd5..24ffb48f 100644 --- a/src/utils/tree-data-utils.js +++ b/src/utils/tree-data-utils.js @@ -834,7 +834,7 @@ function addNodeAtDepthAndIndex({ ignoreCollapsed, expandParent, isLastChild: isLastChild && i === newChildren.length - 1, - node: child, + node: ((currentDepth + 1 >= targetDepth - 1) && child.expanded === false) ? { ...child, expanded: true } : child, currentIndex: childIndex, currentDepth: currentDepth + 1, getNodeKey,