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

16 lines
423 B
TypeScript
Raw Normal View History

2020-11-05 18:58:23 +02:00
import { CommandRuntime, CommandDeclaration } from '@joplinapp/lib/services/CommandService';
import { _ } from '@joplinapp/lib/locale';
export const declaration:CommandDeclaration = {
name: 'focusSearch',
label: () => _('Search in all the notes'),
};
2020-09-15 15:01:07 +02:00
export const runtime = (searchBarRef:any):CommandRuntime => {
return {
execute: async () => {
2020-09-15 15:01:07 +02:00
if (searchBarRef.current) searchBarRef.current.focus();
},
};
};