Revert "Desktop: Fixes #5850: Editor loses cursor focus when Ctrl+F search is closed (#5919)"

This reverts commit b98e64c881.

Ref: https://github.com/laurent22/joplin/issues/6035
pull/6086/head
Laurent Cozic 2022-01-19 08:59:04 +00:00
parent 360293949c
commit c668bb0370
2 changed files with 1 additions and 3 deletions

View File

@ -64,7 +64,7 @@ export default function useEditorSearch(CodeMirror: any) {
}
if (match) {
if (scrollTo) cm.setSelection(match.from, match.to);
if (scrollTo) cm.scrollIntoView(match);
return cm.markText(match.from, match.to, { className: 'cm-search-marker-selected' });
}

View File

@ -1,7 +1,6 @@
import { useState, useCallback } from 'react';
import Logger from '@joplin/lib/Logger';
import { SearchMarkers } from './useSearchMarkers';
const CommandService = require('@joplin/lib/services/CommandService').default;
const logger = Logger.create('useNoteSearchBar');
@ -71,7 +70,6 @@ export default function useNoteSearchBar() {
const onClose = useCallback(() => {
setShowLocalSearch(false);
setLocalSearch(defaultLocalSearch());
void CommandService.instance().execute('focusElementNoteBody');
}, []);
const setResultCount = useCallback((count: number) => {