1
0
mirror of synced 2024-11-25 14:56:03 +03:00

Fixes blur behavior validation bug that failed to expose all validation errors on submission

This commit is contained in:
Justin Schroeder 2018-02-01 11:02:58 -05:00
parent 88663296cd
commit e962aaec62
3 changed files with 4 additions and 6 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -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))
} }
} }
} }

View File

@ -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