Desktop: Fix bug where editor would scroll to focus global search (#3787)

pull/3745/head^2
Caleb John 2020-09-22 06:12:22 -06:00 committed by GitHub
parent 5226f0019b
commit 7202066c1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -119,7 +119,8 @@ export default function useEditorSearch(CodeMirror: any) {
// We only want to highlight all matches when there is only 1 search term
if (keywords.length !== 1 || keywords[0].value == '') {
clearOverlay(this);
setPreviousKeywordValue('');
const prev = keywords.length > 1 ? keywords[0].value : '';
setPreviousKeywordValue(prev);
return 0;
}