Removed semi-automated and incorrect validation error handling in the From Builder. #968
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Whenever any form element was changed, the Form Builder simply cleared out the error messages in the affected form elements. This interfered with the
validationErrors
prop that is given from outside.Because of the semi-automated handling it was not possible to use the same validation error while the element is changed.
Now because the Form Builder is not the one creating the validation errors, it should leave removal to the parent component as well and only notify it, when any form actions created new validation errors.
Type of change
How to test it
Create a new form using the Form Builder and pass in validation errors. They should now only change, when the prop to the Form Builder changes and it should immediately be visible when this prop is changed. The handleChange prop now gets a third param with new validation errors, but as of right now no validation actions exist, yet, so this param will be an empty array.