From 3e9f046a297882499e36f62d6f74e9237726b3b5 Mon Sep 17 00:00:00 2001 From: Sinclair Chen Date: Fri, 16 Sep 2022 15:37:52 -0700 Subject: [PATCH] Always focus search bar on search page --- web/pages/search.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/web/pages/search.tsx b/web/pages/search.tsx index 4eaa49c8..38b9760d 100644 --- a/web/pages/search.tsx +++ b/web/pages/search.tsx @@ -4,7 +4,6 @@ import { ContractSearch } from 'web/components/contract-search' import { useTracking } from 'web/hooks/use-tracking' import { useUser } from 'web/hooks/use-user' import { usePrefetch } from 'web/hooks/use-prefetch' -import { useRouter } from 'next/router' export default function Search() { const user = useUser() @@ -12,10 +11,6 @@ export default function Search() { useTracking('view search') - const { query } = useRouter() - const { q, s, p } = query - const autoFocus = !(q || !s || !p) - return ( @@ -23,7 +18,7 @@ export default function Search() { user={user} persistPrefix="search" useQueryUrlParam={true} - autoFocus={autoFocus} + autoFocus />