diff --git a/components/Search.tsx b/components/Search.tsx index 7a85baf169..286b81ded1 100644 --- a/components/Search.tsx +++ b/components/Search.tsx @@ -1,4 +1,4 @@ -import { useState, useRef } from 'react' +import { useState } from 'react' import { useRouter } from 'next/router' import { IconButton, TextInput } from '@primer/react' import { SearchIcon } from '@primer/octicons-react' @@ -6,14 +6,15 @@ import { SearchIcon } from '@primer/octicons-react' import { useTranslation } from 'components/hooks/useTranslation' import { DEFAULT_VERSION, useVersion } from 'components/hooks/useVersion' import { useQuery } from 'components/hooks/useQuery' +import { useBreakpoint } from './hooks/useBreakpoint' export function Search() { const router = useRouter() const { query, debug } = useQuery() const [localQuery, setLocalQuery] = useState(query) - const inputRef = useRef(null) const { t } = useTranslation('search') const { currentVersion } = useVersion() + const upToMediumViewport = useBreakpoint('medium') function redirectSearch() { let asPath = `/${router.locale}` @@ -41,6 +42,8 @@ export function Search() { redirectSearch() }} > + {/* This prevents zooming in on iOS when you touch the search input text area */} +