diff --git a/apps/web/components/profile/profile-field.tsx b/apps/web/components/profile/profile-field.tsx index d871e51..9fd187c 100644 --- a/apps/web/components/profile/profile-field.tsx +++ b/apps/web/components/profile/profile-field.tsx @@ -78,11 +78,18 @@ function useDebouncedOnChangeCallback( function useFocus(isPending: boolean) { const inputRef = useRef(null); + const [isInitialRender, setIsInitialRender] = useState(true); useEffect(() => { - if (inputRef.current) { + if (isInitialRender) { + setIsInitialRender(false); + return; + } + + if (inputRef.current && isPending) { inputRef.current.focus(); } - }, [isPending]); + }, [isInitialRender, isPending]); + return inputRef; }