[OF#5994] Fix errors for hidden fields#288
Merged
sergei-maertens merged 2 commits intomainfrom Mar 9, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #288 +/- ##
==========================================
+ Coverage 69.26% 69.49% +0.22%
==========================================
Files 288 288
Lines 10823 10913 +90
Branches 1753 1770 +17
==========================================
+ Hits 7497 7584 +87
- Misses 3322 3325 +3
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
494557b to
3b6ac05
Compare
Member
|
Tested with server logic too and now it's behaving as expected with this patch! |
3b6ac05 to
75fbeaf
Compare
viktorvanwijk
approved these changes
Mar 9, 2026
src/visibility.spec.ts
Outdated
| const {updatedErrors} = processVisibility(components, values, errors, { | ||
| parentHidden: false, | ||
| initialValues: {text: ''}, | ||
| initialValues: {text1: '', text2: '', toplevel: ''}, |
Contributor
There was a problem hiding this comment.
Minor thing, but these initial values should also be nested, no? And I guess toplevel cannot be a string
75fbeaf to
00c16fb
Compare
…ion error clearing omission When a field/component becomes hidden, its validation errors in the Formik state must be cleared to not block the form submission. Formik's isValid state looks at the presence of 'errors' in the state and is false as soon as any error is present. Co-authored-by: vasileios <zigras00@gmail.com>
…den fields are cleared Similarly to the values update (from clearOnHide), ensure the error state is updated when a component becomes hidden. We always remove the validation errors for hidden fields, irrespective of clear on hide. We also do not restore validation errors when the field becomes visible again, as the validation schema will restore these, or the backend validation errors will do so. Co-authored-by: vasileios <zigras00@gmail.com>
00c16fb to
d007f0d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes open-formulieren/open-forms#5994 partly