1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/packages/app-desktop/gui/NoteListControls/commands/focusSearch.ts
Siddhant Sehgal 17792d91a1
Desktop: Fixes #4769: highlight existing text in global search field (#4773)
Co-authored-by: Siddhant Sehgal <ssehgal@makelearningbetter.co>
2021-04-06 19:13:43 +01:00

16 lines
421 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.select();
},
};
};