Fix(Form): Fix ref error
This commit is contained in:
@@ -125,10 +125,10 @@ const User = () => {
|
||||
style={{ marginTop: 20 }}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
ref={(ref) => {
|
||||
ref={() => {
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
||||
ref?.getFieldInstance('originalPassword').focus()
|
||||
changePasswordForm?.getFieldInstance('originalPassword').focus()
|
||||
}, 50)
|
||||
}}
|
||||
>
|
||||
@@ -258,10 +258,13 @@ const User = () => {
|
||||
<>
|
||||
<AntdForm
|
||||
form={twoFactorForm}
|
||||
ref={(ref) => {
|
||||
ref={() => {
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
||||
ref?.getFieldInstance('twoFactorCode').focus()
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
twoFactorForm
|
||||
?.getFieldInstance('twoFactorCode')
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
.focus()
|
||||
}, 50)
|
||||
}}
|
||||
>
|
||||
@@ -347,10 +350,13 @@ const User = () => {
|
||||
</AntdTag>
|
||||
<AntdForm
|
||||
form={twoFactorForm}
|
||||
ref={(ref) => {
|
||||
ref={() => {
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
||||
ref?.getFieldInstance('twoFactorCode').focus()
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
twoFactorForm
|
||||
?.getFieldInstance('twoFactorCode')
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
.focus()
|
||||
}, 50)
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user