diff --git a/core/auth/components/FormBuilder.tsx b/core/auth/components/FormBuilder.tsx index 7a732beb32012ff22da16599d69892242ce6936d..f48d491bf4e6a8fb8cf9b86c88c42a0d8e37fabc 100644 --- a/core/auth/components/FormBuilder.tsx +++ b/core/auth/components/FormBuilder.tsx @@ -33,6 +33,7 @@ interface Props<T> { textInputOverride?: TextInputOverride scrollToInputWithId?: (id: string) => ScrollToProps autofocusField?: NodeId + noAutofocusForEmail?: boolean translationPrefix?: string style?: ViewStyle | ViewStyle[] | Record<string, unknown> } @@ -53,6 +54,7 @@ const FormBuilder = < textInputOverride, scrollToInputWithId, autofocusField, + noAutofocusForEmail = false, translationPrefix = 'auth.login.', style, }: Props<T>) => { @@ -68,7 +70,7 @@ const FormBuilder = < const isEmailField = (name: string) => name === 'identifier' || name === 'traits.email' || name === 'email' const hasAutofocus = (node: UiNode) => { const name = getNodeId(node) - const hasFocus = autofocusField === name || isEmailField(name) + const hasFocus = autofocusField === name || (!noAutofocusForEmail && isEmailField(name)) return hasFocus && !(node.attributes as UiNodeInputAttributes).disabled } diff --git a/core/screens/onboarding/steps/CreateAccount.tsx b/core/screens/onboarding/steps/CreateAccount.tsx index 71839d40b4f18e95a11cc561e98677121bf67203..aaaddaf7987dcbee5798195bb5525511d55d42ea 100644 --- a/core/screens/onboarding/steps/CreateAccount.tsx +++ b/core/screens/onboarding/steps/CreateAccount.tsx @@ -149,7 +149,7 @@ export const CreateAccount = ({ </Text> <HoliGap size="xs" /> <Text size="md">{t('registration.signUp.description')}</Text> - <FormBuilder flow={flow} onSubmit={onSubmit} style={styles.loginForm} /> + <FormBuilder flow={flow} onSubmit={onSubmit} style={styles.loginForm} noAutofocusForEmail /> <HoliGap size="s" /> <ButtonTracked label={t('auth.loginProtection.continueAsGuest')}