From 07d1734720692ed24ee62eece574e9cf4bea0c18 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 18 Feb 2023 01:27:59 +0800 Subject: [PATCH] Sometimes autofocus ain't working --- src/pages/search.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/search.jsx b/src/pages/search.jsx index 0cc103b0..8752a504 100644 --- a/src/pages/search.jsx +++ b/src/pages/search.jsx @@ -27,6 +27,7 @@ function Search() { const [accountResults, setAccountResults] = useState([]); const [hashtagResults, setHashtagResults] = useState([]); useEffect(() => { + searchFieldRef.current?.focus?.(); if (q) { searchFieldRef.current.value = q;