Skip to content

Commit

Permalink
Make sure we return the correct valid status from setComponentValidit…
Browse files Browse the repository at this point in the history
…y, also make sure we use showErrorMessages to define if we should set error message instead of formios: (!this.isEmpty(this.defaultValue) || dirty || !this.pristine)
  • Loading branch information
lotorvik committed Dec 3, 2024
1 parent a7c5e8e commit fbd7982
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ class BaseComponent extends FormioReactComponent {
this.rerender();
}

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

return this.componentErrors.length === 0;
}

createError(message: string, elementId?: string): ComponentError {
return {
message,
Expand Down

0 comments on commit fbd7982

Please sign in to comment.