From 952c8cda00f7edf519fd23fc8671a61727f1133f Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 10 Apr 2019 19:30:45 +0100 Subject: [PATCH] Fix a bug that caused it to jump over nodes when pressing too fast --- src/devtools/views/Components/TreeContext.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/devtools/views/Components/TreeContext.js b/src/devtools/views/Components/TreeContext.js index 7d23766767..d610cddfb3 100644 --- a/src/devtools/views/Components/TreeContext.js +++ b/src/devtools/views/Components/TreeContext.js @@ -134,7 +134,11 @@ function reduceTreeState(store: Store, state: State, action: Action): State { const selectedElement = store.getElementAtIndex( ((selectedElementIndex: any): number) ); - if (selectedElement !== null && selectedElement.children.length > 0) { + if ( + selectedElement !== null && + selectedElement.children.length > 0 && + !selectedElement.isCollapsed + ) { const firstChildID = selectedElement.children[0]; const firstChildIndex = store.getIndexOfElementID(firstChildID); if (firstChildIndex !== null) {