diff --git a/src/components/MagicCodeInput.js b/src/components/MagicCodeInput.js index 6dd71ebd1e1c..cea98cfd3747 100644 --- a/src/components/MagicCodeInput.js +++ b/src/components/MagicCodeInput.js @@ -106,17 +106,9 @@ function MagicCodeInput(props) { setFocusedIndex(undefined); }; - const focusMagicCodeInput = () => { - inputRefs.current[0].focus(); - }; - useImperativeHandle(props.innerRef, () => ({ focus() { - focusMagicCodeInput(); - }, - resetFocus() { - setInput(''); - focusMagicCodeInput(); + inputRefs.current[0].focus(); }, clear() { inputRefs.current[0].focus(); diff --git a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js index cfc93701ab1d..a68f99df6d24 100755 --- a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js +++ b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js @@ -113,7 +113,7 @@ function BaseValidateCodeForm(props) { if (!input2FARef.current || prevRequiresTwoFactorAuth || !props.account.requiresTwoFactorAuth) { return; } - input2FARef.current.resetFocus(); + input2FARef.current.focus(); }, [props.account.requiresTwoFactorAuth, prevRequiresTwoFactorAuth]); useEffect(() => {