Reverted misguided index/collapsed behavior
Brian Vaughn committed
Apr 10, 2019 at 09:23 UTC
f89f2b2146fa806c6bcabd23bb3a2af328f31f6b
1 file changed
+1
-6
src/devtools/store.js
+1
-6
@@ -353,12 +353,7 @@ export default class Store extends EventEmitter {
353
break;
354
}
355
const child = ((this._idToElement.get(childID): any): Element);
356
-
357
- // We intentionally ignore collapsed state when determining an item's index.
358
- // We only do this for the direct path to an element.
359
- // That's because the index of the element is meaningless if it's inside of a collapsed tree.
360
- // If this index is used to display the element, the caller should also un-collapse its ancestors.
361
- index += child.weight;
356
+ index += child.isCollapsed ? 1 : child.weight;
357
}
358
359
previousID = current.id;