blitzar
blitzar copied to clipboard
Validations
While attempting to make a multi-step form (using the showCondition to hide fields that are not part of the current step), I had the issue that "on next step" action, the validateFormPerSchema() call was returning errors from the hidden fields. I could have ignored errors from the fields that are not in the step (extra work), but for the form logic it is still problematic to have errors on fields that cannot be modified.
=> validateFieldPerSchema() does not perform validations on fields for which showCondition is false.
I had also the issue that the error prop is expected to be a Boolean by Quasar's QInput.
=> In validateFieldPerSchema() and in evaluateError(), when error is a Boolean and is false, the error message is looked up in the errorMessage prop (if not found, a default fieldValidationError is shown). When error prop returns a string the original behavior is still operational.
I have updated the PR with the latest production branch.
I have added a fix when checking for Required error on a boolean value.
You can try this PR from my project obiba/quasar-ui-amber, and go to the test page BlitzarFormItemsStepsLayoutTest.vue.
Happy new year, any update about this PR? Validation errors on not visible fields is currently a blocker for me.
@ymarcon happy new year
=> validateFieldPerSchema() does not perform validations on fields for which showCondition is false.
This one I agree with, I want to merge it.
For the rest, in order to decide what to do I think I want to finish the Framework examples for the documentation. I want to experience the exact issue with Quasar to make an informative decision.
when error is a Boolean and is
false, the error message is looked up in the errorMessage prop
Do you mean true ?
Yes, sorry I meant true.