diff --git a/CHANGELOG.md b/CHANGELOG.md index f798cc62..d1714101 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 6.8.0 (master) +- Field `invalidate()` methods arguments updated, introduced `deep`. + # 6.7.5 (master) - better handling of `deep` argument for `showErrors()` & `invalidate()` methods. - removed `mixed` mode warning diff --git a/src/Field.ts b/src/Field.ts index 589db176..486ad39c 100755 --- a/src/Field.ts +++ b/src/Field.ts @@ -719,20 +719,21 @@ export default class Field extends Base implements FieldInterface { } } - invalidate(message: string, async: boolean = false): void { + invalidate(message: string, deep: boolean = true, async: boolean = false): void { if (async === true) { this.errorAsync = message; + this.showErrors(true, deep); return; } if (Array.isArray(message)) { this.validationErrorStack = message; - this.showErrors(true); + this.showErrors(true, deep); return; } this.validationErrorStack.unshift(message); - this.showErrors(true); + this.showErrors(true, deep); } setValidationAsyncData(valid: boolean = false, message: string = ""): void { diff --git a/src/models/FieldInterface.ts b/src/models/FieldInterface.ts index 424d3d45..153d76c3 100644 --- a/src/models/FieldInterface.ts +++ b/src/models/FieldInterface.ts @@ -68,7 +68,7 @@ export interface FieldInterface extends BaseInterface { getComputedProp(key: any): any; checkValidationPlugins(): void; initNestedFields(field: any, update: boolean): void; - invalidate(message?: string, async?: boolean): void; + invalidate(message?: string, deep?: boolean, async?: boolean): void; setValidationAsyncData(valid: boolean, message: string): void; resetValidation(deep: boolean): void; clear(deep?: boolean): void;