@samitouri / QOS-React / commits / 952c8cda00

Fix a bug that caused it to jump over nodes when pressing too fast

Dan Abramov committed Apr 10, 2019 at 19:30 UTC 952c8cda00f7edf519fd23fc8671a61727f1133f
1 file changed +5 -1
src/devtools/views/Components/TreeContext.js
+5 -1
@@ -134,7 +134,11 @@ function reduceTreeState(store: Store, state: State, action: Action): State {
134 const selectedElement = store.getElementAtIndex(
135 ((selectedElementIndex: any): number)
136 );
137 - if (selectedElement !== null && selectedElement.children.length > 0) {
137 + if (
138 + selectedElement !== null &&
139 + selectedElement.children.length > 0 &&
140 + !selectedElement.isCollapsed
141 + ) {
142 const firstChildID = selectedElement.children[0];
143 const firstChildIndex = store.getIndexOfElementID(firstChildID);
144 if (firstChildIndex !== null) {