summaryrefslogtreecommitdiffstats
path: root/src/components/SearchForm
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/SearchForm')
-rw-r--r--src/components/SearchForm/SearchForm.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/SearchForm/SearchForm.tsx b/src/components/SearchForm/SearchForm.tsx
index c1a7ca7..cefda85 100644
--- a/src/components/SearchForm/SearchForm.tsx
+++ b/src/components/SearchForm/SearchForm.tsx
@@ -13,10 +13,10 @@ const SearchForm = ({ isOpened }: { isOpened: boolean }) => {
useEffect(() => {
setTimeout(() => {
- if (inputRef.current) {
+ if (isOpened && inputRef.current) {
inputRef.current.focus();
}
- }, 800);
+ }, 400);
}, [isOpened]);
const launchSearch = (e: FormEvent) => {