Fixes blur behavior validation bug that failed to expose all validation errors on submission
This commit is contained in:
parent
88663296cd
commit
e962aaec62
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -112,9 +112,7 @@ export default {
|
|||||||
return errors
|
return errors
|
||||||
},
|
},
|
||||||
updateFormValidation () {
|
updateFormValidation () {
|
||||||
this.fields.map(field => {
|
console.log(this.fields)
|
||||||
console.log(field.validationLabel || field.label || field.name)
|
|
||||||
})
|
|
||||||
this.fields.map(async field => this.validateField({
|
this.fields.map(async field => this.validateField({
|
||||||
field: field.name,
|
field: field.name,
|
||||||
validation: field.validation,
|
validation: field.validation,
|
||||||
@ -125,7 +123,7 @@ export default {
|
|||||||
if (this.hasErrors) {
|
if (this.hasErrors) {
|
||||||
this.forceErrors = true
|
this.forceErrors = true
|
||||||
} else {
|
} else {
|
||||||
alert('submitting form')
|
this.$emit('submit', Object.assign({}, this.values))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ export default {
|
|||||||
shouldShowErrors () {
|
shouldShowErrors () {
|
||||||
let show = this.form.shouldShowErrors
|
let show = this.form.shouldShowErrors
|
||||||
if (this.form.behavior === 'blur') {
|
if (this.form.behavior === 'blur') {
|
||||||
show = this.errorBlurState
|
show = show || this.errorBlurState
|
||||||
}
|
}
|
||||||
if (this.showErrors === false || this.showErrors === true) {
|
if (this.showErrors === false || this.showErrors === true) {
|
||||||
show = this.showErrors
|
show = this.showErrors
|
||||||
|
Loading…
Reference in New Issue
Block a user