myrta-ui 1.1.44 → 1.1.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4532,7 +4532,7 @@ const callbackValidation = (value, validations, key, invalidMessages) => {
4532
4532
  if (validations[ValidationTypesEnum.Callback] && typeof validations[ValidationTypesEnum.Callback] === 'function') {
4533
4533
  const validation = validations[ValidationTypesEnum.Callback];
4534
4534
  const callbackResult = validation(value);
4535
- if (callbackResult !== null) {
4535
+ if (callbackResult !== true) {
4536
4536
  result.message = getErrorMessageHelper(key, invalidMessages, validations.messages || { callback: callbackResult });
4537
4537
  result.isValid = false;
4538
4538
  }
@@ -4698,6 +4698,11 @@ class MrxFormValidator {
4698
4698
  this.fields = cloneDeep(fields);
4699
4699
  this._validations = validations;
4700
4700
  this._modelClone = cloneDeep(fields);
4701
+ for (let key in this._errors) {
4702
+ if (!fields.hasOwnProperty(key)) {
4703
+ delete this._errors[key];
4704
+ }
4705
+ }
4701
4706
  for (let key in validations) {
4702
4707
  this._validations[key] = getSortingValidationsHelper(validations[key]);
4703
4708
  this.errors[key] = null;
@@ -4708,11 +4713,6 @@ class MrxFormValidator {
4708
4713
  if (this._isInit) {
4709
4714
  this._isValid = true;
4710
4715
  this._modelClone = cloneDeep(fields);
4711
- for (let key in this._errors) {
4712
- if (!fields.hasOwnProperty(key)) {
4713
- delete this._errors[key];
4714
- }
4715
- }
4716
4716
  this.getNamesUpdatedProperties(this._fields, fields).forEach((name) => {
4717
4717
  this._errors[name] = null;
4718
4718
  if (this._method === ValidationMethodsEnum.Input) {