diff --git a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx index b7f1b6c2a8c8f..50bd22bc9f41b 100644 --- a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx +++ b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx @@ -45,7 +45,7 @@ export function SearchBar({ globalSearch, navigateToUrl }: Props) { const [searchValue, setSearchValue] = useState(''); const [searchRef, setSearchRef] = useState(null); const [options, _setOptions] = useState([] as EuiSelectableTemplateSitewideOption[]); - const isWindows = navigator.platform.toLowerCase().indexOf('win') >= 0; + const isMac = navigator.platform.toLowerCase().indexOf('mac') >= 0; const setOptions = useCallback( (_options: GlobalSearchResult[]) => { @@ -106,7 +106,7 @@ export function SearchBar({ globalSearch, navigateToUrl }: Props) { ); const onKeyDown = (event: KeyboardEvent) => { - if (event.key === '/' && (isWindows ? event.ctrlKey : event.metaKey)) { + if (event.key === '/' && (isMac ? event.metaKey : event.ctrlKey)) { if (searchRef) { event.preventDefault(); searchRef.focus(); @@ -176,7 +176,7 @@ export function SearchBar({ globalSearch, navigateToUrl }: Props) { what: Shortcut, how: ( - {isWindows ? 'Control + /' : 'Command + /'} + {isMac ? 'Command + /' : 'Control + /'} ), }}