From 2c29ea388b7abeefc645908fc38136be8d66a157 Mon Sep 17 00:00:00 2001 From: CalebJohn Date: Mon, 21 Sep 2020 12:31:58 -0600 Subject: [PATCH] Fix bug where editor would scroll to focus global search --- .../NoteEditor/NoteBody/CodeMirror/utils/useEditorSearch.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/useEditorSearch.ts b/ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/useEditorSearch.ts index 1ce275f4607..4f72c706dc8 100644 --- a/ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/useEditorSearch.ts +++ b/ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/utils/useEditorSearch.ts @@ -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; }