Skip to content

Commit

Permalink
Fix firefox-devtools#5918 - Prevent index weirdness
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Jun 21, 2018
1 parent 7a9a8b3 commit eacf88c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/shared/ManagedTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,14 @@ class ManagedTree extends Component<Props, State> {
// closed folder and highlights this folder
const index = highlightItems
.reverse()
.findIndex(item => !expanded.has(this.props.getPath(item)));
this.focusItem(highlightItems[index]);
.findIndex(
item =>
!expanded.has(this.props.getPath(item)) && item.name !== "root"
);

if (highlightItems[index]) {
this.focusItem(highlightItems[index]);
}
}
}

Expand Down

0 comments on commit eacf88c

Please sign in to comment.