Don't auto expand if it's root in indexTreeModel. Fixes #79540

This commit is contained in:
jeanp413 2019-08-20 20:57:33 -05:00
parent 98467c3b7c
commit 2ebaa78e87

View file

@ -219,7 +219,7 @@ export class IndexTreeModel<T extends Exclude<any, undefined>, TFilterData = voi
const result = this._setListNodeCollapsed(node, listIndex, revealed, collapsed!, recursive || false);
if (this.autoExpandSingleChildren && !collapsed! && !recursive) {
if (node !== this.root && this.autoExpandSingleChildren && !collapsed! && !recursive) {
let onlyVisibleChildIndex = -1;
for (let i = 0; i < node.children.length; i++) {