Fixed bug with empty validations

This commit is contained in:
Christian Alfoni 2015-01-14 10:32:31 +01:00
parent e9743a2df1
commit 9e430bbf83
6 changed files with 8 additions and 5 deletions

View File

@ -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

View File

@ -1,6 +1,6 @@
{
"name": "formsy-react",
"version": "0.5.0",
"version": "0.5.1",
"main": "src/main.js",
"dependencies": {
"react": "^0.11.2"

View File

@ -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": {

View File

@ -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

View File

@ -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();