1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/app-desktop/gui/NoteListControls/commands/focusSearch.ts

16 lines
420 B
TypeScript

import { CommandRuntime, CommandDeclaration } from '@joplin/lib/services/CommandService';
import { _ } from '@joplin/lib/locale';
export const declaration: CommandDeclaration = {
name: 'focusSearch',
label: () => _('Search in all the notes'),
};
export const runtime = (searchBarRef: any): CommandRuntime => {
return {
execute: async () => {
if (searchBarRef.current) searchBarRef.current.focus();
},
};
};