mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-24 11:05:17 +08:00
Revert "fix(components): [el-form]: ensure form validation always triggers callback (#3294)" (#3324)
This reverts commit 509292678d
.
This commit is contained in:
parent
509292678d
commit
fc74a232a0
@ -184,6 +184,7 @@ export default defineComponent({
|
||||
callback(true)
|
||||
}
|
||||
let valid = true
|
||||
let count = 0
|
||||
let invalidFields = {}
|
||||
let firstInvalidFields
|
||||
for (const field of fields) {
|
||||
@ -193,10 +194,11 @@ export default defineComponent({
|
||||
firstInvalidFields || (firstInvalidFields = field)
|
||||
}
|
||||
invalidFields = { ...invalidFields, ...field }
|
||||
if (++count === fields.length) {
|
||||
callback(valid, invalidFields)
|
||||
}
|
||||
})
|
||||
}
|
||||
callback(valid, invalidFields)
|
||||
|
||||
if (!valid && props.scrollToError) {
|
||||
scrollToField(Object.keys(firstInvalidFields)[0])
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user