From 9d2c2b96e877494f95d8f175f965804a80ff25f0 Mon Sep 17 00:00:00 2001 From: Felix Wotschofsky Date: Thu, 19 Sep 2024 19:40:40 +0200 Subject: [PATCH] =?UTF-8?q?Re-focus=20search=20form=20on=20IP=20modal=20cl?= =?UTF-8?q?ose=20=F0=9F=91=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/_components/search-form.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/_components/search-form.tsx b/app/_components/search-form.tsx index e891426..caf865a 100644 --- a/app/_components/search-form.tsx +++ b/app/_components/search-form.tsx @@ -266,6 +266,16 @@ export const SearchForm: FC = (props) => { setSuggestionsVisible(true); }, [isFirstRender, setSuggestionsVisible]); + const handleIpDetailsOpenChange = useCallback( + (open: boolean) => { + setIpDetailsOpen(open); + if (!open) { + inputRef.current?.focus(); + } + }, + [setIpDetailsOpen, inputRef] + ); + return ( <>
@@ -357,7 +367,7 @@ export const SearchForm: FC = (props) => { );