Fix modal can not focus second input bug

This commit is contained in:
2024-03-01 16:35:49 +08:00
parent e2dfe89d04
commit 3b11b262b9
8 changed files with 178 additions and 85 deletions

View File

@@ -336,15 +336,25 @@ const User = () => {
{value.username}
</>
),
getContainer: false,
centered: true,
maskClosable: true,
footer: (_, { OkBtn, CancelBtn }) => (
<>
<OkBtn />
<CancelBtn />
</>
),
content: (
<AntdForm
form={changePasswordForm}
style={{ marginTop: 20 }}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
ref={(ref) => {
setTimeout(() => {
ref?.getFieldInstance('password').focus()
}, 50)
}}
>
<AntdForm.Item name={'id'} label={'ID'} labelAlign={'right'}>
<AntdInput disabled />
@@ -358,11 +368,7 @@ const User = () => {
}
]}
>
<AntdInput.Password
ref={(input) => {
input?.focus()
}}
/>
<AntdInput.Password />
</AntdForm.Item>
<AntdForm.Item
name={'passwordConfirm'}