From da376402a4741eda16f076fed0c426d301f32808 Mon Sep 17 00:00:00 2001 From: foxhound87 Date: Sun, 14 Jan 2024 12:04:43 +0100 Subject: [PATCH] fix: fix: call `invalidate()` with `deep` argument --- CHANGELOG.md | 3 +++ src/validators/DVR.ts | 4 ++-- src/validators/SVK.ts | 4 ++-- src/validators/VJF.ts | 4 ++-- src/validators/YUP.ts | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0513c13..7eab219e 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 6.8.2 (master) +- Fix: call `invalidate()` with `deep` argument. + # 6.8.1 (master) - Fix: call `invalidate()` with `async` argument. diff --git a/src/validators/DVR.ts b/src/validators/DVR.ts index 5939b06a..409c11e7 100755 --- a/src/validators/DVR.ts +++ b/src/validators/DVR.ts @@ -96,7 +96,7 @@ export class DVR implements ValidationPluginInterface { // check validation if (validation.passes()) return; // the validation is failed, set the field error - field.invalidate(_.head(validation.errors.get(field.path))); + field.invalidate(_.head(validation.errors.get(field.path)), false); } validateFieldAsync(field, data) { @@ -138,7 +138,7 @@ export class DVR implements ValidationPluginInterface { executeAsyncValidation(field) { if (field.validationAsyncData.valid === false) { - field.invalidate(field.validationAsyncData.message, true); + field.invalidate(field.validationAsyncData.message, false, true); } } diff --git a/src/validators/SVK.ts b/src/validators/SVK.ts index 26fa8954..2583859e 100755 --- a/src/validators/SVK.ts +++ b/src/validators/SVK.ts @@ -97,7 +97,7 @@ class SVK implements ValidationPluginInterface { // add additional info to the message const msg = `${field.label} ${fieldErrorObj.message}`; // invalidate the current field with message - field.invalidate(msg); + field.invalidate(msg, false); } handleAsyncError(field, errors) { @@ -124,7 +124,7 @@ class SVK implements ValidationPluginInterface { executeAsyncValidation(field) { if (field.validationAsyncData.valid === false) { - field.invalidate(field.validationAsyncData.message, true, true); + field.invalidate(field.validationAsyncData.message, false, true); } } diff --git a/src/validators/VJF.ts b/src/validators/VJF.ts index 9997e3bb..e5c76ed2 100755 --- a/src/validators/VJF.ts +++ b/src/validators/VJF.ts @@ -92,13 +92,13 @@ export class VJF implements ValidationPluginInterface { executeValidation(field) { // otherwise find an error message to show field.validationFunctionsData.map( - (rule) => rule.valid === false && field.invalidate(rule.message) + (rule) => rule.valid === false && field.invalidate(rule.message, false) ); } executeAsyncValidation(field) { if (field.validationAsyncData.valid === false) { - field.invalidate(field.validationAsyncData.message, true, true); + field.invalidate(field.validationAsyncData.message, false, true); } } diff --git a/src/validators/YUP.ts b/src/validators/YUP.ts index 23f8faf0..aa897ec7 100755 --- a/src/validators/YUP.ts +++ b/src/validators/YUP.ts @@ -81,7 +81,7 @@ class YUP implements ValidationPluginInterface { executeAsyncValidation(field) { if (field.validationAsyncData.valid === false) { - field.invalidate(field.validationAsyncData.message, true, true); + field.invalidate(field.validationAsyncData.message, false, true); } } }