1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Desktop, Mobile: Improve focus handling

This commit is contained in:
Laurent Cozic
2024-04-01 15:34:22 +01:00
parent 554fb7026a
commit 00084c5798
34 changed files with 119 additions and 92 deletions

View File

@ -1,5 +1,6 @@
import { CommandRuntime, CommandDeclaration } from '@joplin/lib/services/CommandService';
import { _ } from '@joplin/lib/locale';
import { focus } from '@joplin/lib/utils/focusHandler';
export const declaration: CommandDeclaration = {
name: 'showLocalSearch',
@ -13,7 +14,7 @@ export const runtime = (comp: any): CommandRuntime => {
comp.editorRef.current.execCommand({ name: 'search' });
} else {
if (comp.noteSearchBarRef.current) {
comp.noteSearchBarRef.current.focus();
focus('showLocalSearch', comp.noteSearchBarRef.current);
} else {
comp.setShowLocalSearch(true);
}