Filter error keywords before touch #2540
Open
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.
A new configuration option, filterErrorKeywordsBeforeTouch, allows selective suppression of validation errors before a control is touched, based on AJV error keywords.
This option exists because in most real-world forms, only certain errors—most commonly required—should be hidden prior to user interaction. Other validation errors (such as minLength, pattern, or format) often provide useful guidance and should remain visible immediately.
Instead of hiding all validation errors before interaction, you can now explicitly choose which error types are suppressed and which are shown.
This option is only applied when enableFilterErrorsBeforeTouch is enabled.
If enableFilterErrorsBeforeTouch is false, filterErrorKeywordsBeforeTouch has no effect and all validation errors are shown immediately.
If enableFilterErrorsBeforeTouch is true and filterErrorKeywordsBeforeTouch is not provided, the default behavior applies: no validation errors are shown before the control is touched.
Once the control is touched, all validation errors are always displayed, regardless of these settings.