diff --git a/src/components/common/PasswordForm.tsx b/src/components/common/PasswordForm.tsx index 76a63a0a..3e4e3b21 100644 --- a/src/components/common/PasswordForm.tsx +++ b/src/components/common/PasswordForm.tsx @@ -50,6 +50,15 @@ const PasswordForm: FC = ({ } }, []); + useEffect(() => { + if (error) { + requestAnimationFrame(() => { + inputRef.current!.focus(); + inputRef.current!.select(); + }); + } + }, [error]); + function onPasswordChange(e: ChangeEvent) { if (error) { clearError();