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:
parent
2ec21a778b
commit
16b3c580e6
4 changed files with 8 additions and 1 deletions
|
@ -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"
|
||||
|
|
|
@ -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={
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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={
|
||||
|
|
Loading…
Add table
Reference in a new issue