fix: 校验输入框删除内容时输入内容闪烁

This commit is contained in:
hezhihang 2024-07-03 14:11:27 +08:00
parent 83fba50e14
commit b579a44683

View File

@ -156,10 +156,6 @@ export default class ValidationItem extends React.Component<
'错误提示',
`系统默认提示:${this.validator.message}`
),
pipeIn: (value: string, data: any) => {
// value中 $1 会被运算,导致无法正确回显$1。此处从this.props.data中获取该校验项的错误提示
return this.props.data.message;
},
placeholder: '默认使用系统定义提示'
});
}
@ -185,14 +181,10 @@ export default class ValidationItem extends React.Component<
},
preventEnterSubmit: true,
submitOnChange: true,
body: control,
data: {value, message}
body: control
},
{
data: {
...this.props.data,
fields
},
data: {value, message, fields},
onSubmit: this.handleEdit
}
)}