0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-31 22:51:25 -05:00

fix(console): add auto focus to inputs in ac profile modals (#3339)

This commit is contained in:
Charles Zhao 2023-03-13 11:07:24 +08:00 committed by GitHub
parent 2ec21a778b
commit 16b3c580e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 1 deletions

View file

@ -42,7 +42,6 @@ const BasicUserInfoUpdateModal = ({ field, value: initialValue, isOpen, onClose
handleSubmit,
setValue,
reset,
setError,
formState: { errors, isSubmitting },
} = useForm<FormFields>({ reValidateMode: 'onBlur' });
@ -130,6 +129,8 @@ const BasicUserInfoUpdateModal = ({ field, value: initialValue, isOpen, onClose
!!value ||
t('errors.required_field_missing', { field: t(`profile.settings.${field}`) }),
})}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
placeholder={getInputPlaceholder()}
errorMessage={errors[field]?.message}
size="large"

View file

@ -104,6 +104,8 @@ const ChangePasswordModal = () => {
message: t('errors.password_pattern_error'),
},
})}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
type={showPassword ? 'text' : 'password'}
errorMessage={errors.newPassword?.message}
suffix={

View file

@ -61,6 +61,8 @@ const LinkEmailModal = () => {
currentEmail !== value ||
t('profile.link_account.identical_email_address'),
})}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
errorMessage={errors.email?.message}
size="large"
onKeyDown={(event) => {

View file

@ -76,6 +76,8 @@ const VerifyPasswordModal = () => {
>
<TextInput
{...register('password', { required: t('profile.password.required') })}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
errorMessage={errors.password?.message}
type={showPassword ? 'text' : 'password'}
suffix={