Validation should return undefined in case of async validations
This commit is contained in:
parent
66e311f8a0
commit
76a2f9a22c
|
@ -143,11 +143,13 @@ Validatable.prototype.isValid = function (callback) {
|
|||
if (!async) {
|
||||
if (valid) cleanErrors(this);
|
||||
if (callback) callback(valid);
|
||||
return valid;
|
||||
} else {
|
||||
// in case of async validation we should return undefined here,
|
||||
// because not all validations are finished yet
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return valid;
|
||||
};
|
||||
|
||||
function cleanErrors(inst) {
|
||||
|
|
Loading…
Reference in New Issue