Fixed bug with empty validations
This commit is contained in:
parent
e9743a2df1
commit
9e430bbf83
|
|
@ -62,6 +62,9 @@ The main concept is that forms, inputs and validation is done very differently a
|
|||
|
||||
## <a name="changes">Changes</a>
|
||||
|
||||
**0.5.1**
|
||||
- Fixed bug with empty validations
|
||||
|
||||
**0.5.0**
|
||||
- Added [cross input validation](#formsyaddvalidationrule)
|
||||
- Fixed bug where validation rule refers to a string
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "formsy-react",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"main": "src/main.js",
|
||||
"dependencies": {
|
||||
"react": "^0.11.2"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "formsy-react",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"description": "A form input builder and validator for React JS",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ Formsy.Form = React.createClass({
|
|||
|
||||
runValidation: function (component) {
|
||||
var isValid = true;
|
||||
if (component.props.required || component.state._value !== '') {
|
||||
if (component._validations.length && (component.props.required || component.state._value !== '')) {
|
||||
component._validations.split(',').forEach(function (validation) {
|
||||
var args = validation.split(':');
|
||||
var validateMethod = args.shift();
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -325,7 +325,7 @@ Formsy.Form = React.createClass({
|
|||
|
||||
runValidation: function (component) {
|
||||
var isValid = true;
|
||||
if (component.props.required || component.state._value !== '') {
|
||||
if (component._validations.length && (component.props.required || component.state._value !== '')) {
|
||||
component._validations.split(',').forEach(function (validation) {
|
||||
var args = validation.split(':');
|
||||
var validateMethod = args.shift();
|
||||
|
|
|
|||
Loading…
Reference in New Issue