fix(form-core): prevValidationResult initialize as empty array
This commit is contained in:
parent
f9fce2d833
commit
b2a1c1efd4
3 changed files with 8 additions and 1 deletions
5
.changeset/loud-planes-doubt.md
Normal file
5
.changeset/loud-planes-doubt.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@lion/form-core': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Make sure prev validation result is always an array (of validators) and not undefined.
|
||||||
|
|
@ -10,7 +10,7 @@ export class ResultValidator extends Validator {
|
||||||
/**
|
/**
|
||||||
* @param {Object} context
|
* @param {Object} context
|
||||||
* @param {Validator[]} context.regularValidationResult
|
* @param {Validator[]} context.regularValidationResult
|
||||||
* @param {Validator[] | undefined} context.prevValidationResult
|
* @param {Validator[]} context.prevValidationResult
|
||||||
* @param {Validator[]} [context.validators]
|
* @param {Validator[]} [context.validators]
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,8 @@ export const ValidateMixinImplementation = superclass =>
|
||||||
* @type {Validator[]}
|
* @type {Validator[]}
|
||||||
*/
|
*/
|
||||||
this.__validationResult = [];
|
this.__validationResult = [];
|
||||||
|
/** @type {Validator[]} */
|
||||||
|
this.__prevValidationResult = [];
|
||||||
|
|
||||||
this.__onValidatorUpdated = this.__onValidatorUpdated.bind(this);
|
this.__onValidatorUpdated = this.__onValidatorUpdated.bind(this);
|
||||||
this._updateFeedbackComponent = this._updateFeedbackComponent.bind(this);
|
this._updateFeedbackComponent = this._updateFeedbackComponent.bind(this);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue