Reverted misguided index/collapsed behavior

This commit is contained in:
Brian Vaughn
2019-04-10 09:23:24 -07:00
parent 74c9904e5d
commit f89f2b2146
+1 -6
View File
@@ -353,12 +353,7 @@ export default class Store extends EventEmitter {
break;
}
const child = ((this._idToElement.get(childID): any): Element);
// We intentionally ignore collapsed state when determining an item's index.
// We only do this for the direct path to an element.
// That's because the index of the element is meaningless if it's inside of a collapsed tree.
// If this index is used to display the element, the caller should also un-collapse its ancestors.
index += child.weight;
index += child.isCollapsed ? 1 : child.weight;
}
previousID = current.id;