Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/devtools/views/Components/TreeContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ function reduceSearchState(store: Store, state: State, action: Action): State {
} = state;

const prevSearchIndex = searchIndex;
const prevSearchText = searchText;
const numPrevSearchResults = searchResults.length;

// Search isn't supported when the owner's tree is active.
Expand Down Expand Up @@ -307,8 +308,8 @@ function reduceSearchState(store: Store, state: State, action: Action): State {
}
}

// Changes in search index should override the selected element.
if (searchIndex !== prevSearchIndex) {
// Changes in search index or typing should override the selected element.
if (searchIndex !== prevSearchIndex || searchText.indexOf(prevSearchText) === 0) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Yeah this makes sense.

if (searchIndex === null) {
selectedElementIndex = null;
selectedElementID = null;
Expand Down