vue-form-generator icon indicating copy to clipboard operation
vue-form-generator copied to clipboard

Add the distinction between actual form errors and errors displayed

Open Rydra opened this issue 6 years ago • 2 comments

If any of its fields of a form are invalid the entire form should be considered invalid even if the errors are not displayed for example due to the isNewModel property (which does not show all field errors at the beginning). So I created the distinction between the actual errors of the form, and the errors that are being displayed in the form.

I was facing a use case where I needed to have a submit button disabled until the form was correctly filled, but neither show the validation errors until the user reached the field for the first time. With how isNewModel was implemented this behaviour was not possible, the errors were being cleaned but when validated event was raised the isValid value was always true, so I introduced this functionality. If you supply isNewModel to false (the default) the behaviour is the same as it was before.

Rydra avatar Mar 07 '19 19:03 Rydra

interesting... I'll try to review this more thoroughly and get the PR merged or my feedback back to you ASAP

zoul0813 avatar Mar 07 '19 19:03 zoul0813

Coverage Status

Coverage remained the same at 89.979% when pulling 8ae1517db50390da8a8bad43d418fa01e3854c09 on Rydra:feature/actual-errors-on-isNewModel into 721a4eebbde77040a1318e60aa9ef21229bbcf99 on vue-generators:master.

coveralls avatar Mar 07 '19 20:03 coveralls