Skip to content

Commit

Permalink
Add extra check for setComponentValidity that was used in formio
Browse files Browse the repository at this point in the history
  • Loading branch information
lotorvik committed Dec 4, 2024
1 parent 77ef184 commit 2232a10
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ class BaseComponent extends FormioReactComponent {
}

setComponentValidity(messages, dirty, silentCheck) {
if (messages.length && (!silentCheck || this.error) && this.showErrorMessages()) {
if (
messages.length &&
(!silentCheck || this.error) &&
this.showErrorMessages() &&
(!this.isEmpty(this.defaultValue) || dirty || !this.pristine)
) {
this.setCustomValidity(messages, dirty);
} else {
this.setCustomValidity('');
Expand Down

0 comments on commit 2232a10

Please sign in to comment.