fix: show the default validation message when there is a required error (#386)
* Show the default validation error message when required is invalid * Fix showError
This commit is contained in:
parent
d68586180a
commit
ac301f8950
|
|
@ -166,7 +166,7 @@ module.exports = {
|
|||
return this.state._isRequired;
|
||||
},
|
||||
showError: function () {
|
||||
return !this.showRequired() && !this.isValid();
|
||||
return this.showRequired() && !this.isValid();
|
||||
},
|
||||
isValidValue: function (value) {
|
||||
return this.context.formsy.isValidValue.call(null, this, value);
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ Formsy.Form = React.createClass({
|
|||
}
|
||||
|
||||
if (isRequired) {
|
||||
var error = validationErrors[requiredResults.success[0]];
|
||||
var error = validationErrors[requiredResults.success[0]] || validationError;
|
||||
return error ? [error] : null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue