Skip to content

Commit

Permalink
Merge pull request #25866 from tusharwebd/search-show-shortcuts-deskt…
Browse files Browse the repository at this point in the history
…op-only

UI: Remove keyboard shortcut hint in search bar on mobile viewports
  • Loading branch information
ndelangen authored Feb 6, 2024
2 parents 0f8374f + 4b342ac commit 6b09633
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/ui/manager/src/components/sidebar/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { isSearchResult, isExpandType } from './types';

import { scrollIntoView, searchItem } from '../../utils/tree';
import { getGroupStatus, getHighestStatus } from '../../utils/status';
import { useLayout } from '../layout/LayoutProvider';

const { document } = global;

Expand Down Expand Up @@ -288,6 +289,7 @@ export const Search = React.memo<{
},
[inputRef, selectStory, showAllComponents]
);
const { isMobile } = useLayout();

return (
<Downshift<DownshiftItem>
Expand Down Expand Up @@ -359,7 +361,7 @@ export const Search = React.memo<{
</SearchIconWrapper>
{/* @ts-expect-error (TODO) */}
<Input {...inputProps} />
{enableShortcuts && !isOpen && (
{!isMobile && enableShortcuts && !isOpen && (
<FocusKey>
{searchShortcut === '⌘ K' ? (
<>
Expand Down

0 comments on commit 6b09633

Please sign in to comment.