Skip to content

Commit 27b894c

Browse files
authored
feat(account-center): auto-focus first input (#8107)
1 parent 2694c6e commit 27b894c

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

packages/account-center/src/components/PasswordVerification/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ const PasswordVerification = ({ onBack, onSwitchMethod, hasAlternativeMethod }:
5858
>
5959
<form noValidate className={styles.form} onSubmit={handleVerify}>
6060
<PasswordInputField
61+
// eslint-disable-next-line jsx-a11y/no-autofocus
62+
autoFocus
6163
autoComplete="current-password"
6264
label={t('input.password')}
6365
value={password}

packages/account-center/src/pages/CodeFlow/IdentifierSendStep.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ const IdentifierSendStep = ({
9494
<SecondaryPageLayout title={titleKey} description={descriptionKey}>
9595
<form className={styles.container} onSubmit={handleSend}>
9696
<SmartInputField
97+
// eslint-disable-next-line jsx-a11y/no-autofocus
98+
autoFocus
9799
className={styles.identifierInput}
98100
name={name}
99101
label={t(labelKey)}

packages/account-center/src/pages/PasskeyView/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ const PasskeyView = () => {
299299
<div className={styles.editModalContent}>
300300
<DynamicT forKey="account_center.passkey.rename_description" />
301301
<InputField
302+
// eslint-disable-next-line jsx-a11y/no-autofocus
303+
autoFocus
302304
name="passkeyName"
303305
value={editName}
304306
required={false}

packages/account-center/src/pages/Password/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ const Password = () => {
126126
<SecondaryPageLayout title="account_center.password.title" description={description}>
127127
<div className={styles.container}>
128128
<SetPassword
129-
errorMessage={errorMessage}
129+
// eslint-disable-next-line jsx-a11y/no-autofocus
130+
autoFocus
130131
clearErrorMessage={clearErrorMessage}
132+
errorMessage={errorMessage}
131133
maxLength={passwordPolicy.length.max}
132134
onSubmit={async (value) => handleSubmit(value)}
133135
/>

packages/account-center/src/pages/Username/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ const Username = () => {
109109
<form className={styles.container} onSubmit={handleSubmit}>
110110
<SmartInputField
111111
key={inputKey}
112+
// eslint-disable-next-line jsx-a11y/no-autofocus
113+
autoFocus
112114
className={styles.identifierInput}
113115
name="username"
114116
label={t('input.username')}

0 commit comments

Comments
 (0)