fix: Fixed issue where the first input in the challenge modal would get focused when typing in another input

This commit is contained in:
Aman Harwara
2023-02-01 19:07:44 +05:30
parent 841b208684
commit 9be4f5b4cd

View File

@@ -49,9 +49,15 @@ const ChallengeModalPrompt: FunctionComponent<Props> = ({
}
biometricsButtonRef.current?.click()
} else {
inputRef.current?.focus()
return
}
const parentForm = inputRef.current?.closest('form')
if (parentForm?.contains(document.activeElement)) {
return
}
inputRef.current?.focus()
}, [application, prompt.id, prompt.validation, values])
useEffect(() => {