fix(Form): may scroll to incorrect field after submitted (#8159)
This commit is contained in:
+2
-2
@@ -159,10 +159,10 @@ export default createComponent({
|
||||
.then(() => {
|
||||
emit('submit', values);
|
||||
})
|
||||
.catch((errors) => {
|
||||
.catch((errors: FieldValidateError[]) => {
|
||||
emit('failed', { values, errors });
|
||||
|
||||
if (props.scrollToError) {
|
||||
if (props.scrollToError && errors[0].name) {
|
||||
scrollToField(errors[0].name);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user