diff --git a/API.md b/API.md
index 2bbb8f1..1a31266 100644
--- a/API.md
+++ b/API.md
@@ -212,7 +212,7 @@ You should always use the [**getValue()**](#getvalue) method inside your formsy
}
}}/>
```
-An comma seperated list with validation rules. Take a look at [**Validators**](#validators) to see default rules. Use ":" to separate argument passed to the validator. The argument will go through a **JSON.parse** converting them into correct JavaScript types. Meaning:
+An comma separated list with validation rules. Take a look at [**Validators**](#validators) to see default rules. Use ":" to separate argument passed to the validator. The argument will go through a **JSON.parse** converting them into correct JavaScript types. Meaning:
```html
diff --git a/README.md b/README.md
index 7571ecf..d102b58 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-formsy-react [](https://github.com/christianalfoni/formsy-react/releases) 
+formsy-react [](https://github.com/christianalfoni/formsy-react/releases) [](https://travis-ci.org/christianalfoni/formsy-react)
============
A form input builder and validator for React JS
diff --git a/examples/custom-validation/app.js b/examples/custom-validation/app.js
index bd5fd32..beef629 100644
--- a/examples/custom-validation/app.js
+++ b/examples/custom-validation/app.js
@@ -1,4 +1,5 @@
var React = require('react');
+var ReactDOM = require('react-dom');
var Formsy = require('formsy-react');
var currentYear = new Date().getFullYear();
@@ -107,17 +108,17 @@ var Validations = React.createClass({
);
}
});
-React.render(, document.getElementById('example'));
+ReactDOM.render(, document.getElementById('example'));
diff --git a/examples/login/app.js b/examples/login/app.js
index 24439c2..d6e0da8 100644
--- a/examples/login/app.js
+++ b/examples/login/app.js
@@ -1,4 +1,5 @@
var React = require('react');
+var ReactDOM = require('react-dom');
var Formsy = require('formsy-react');
var App = React.createClass({
@@ -62,4 +63,4 @@ var MyOwnInput = React.createClass({
}
});
-React.render(, document.getElementById('example'));
+ReactDOM.render(, document.getElementById('example'));
diff --git a/package.json b/package.json
index d74bf42..2094847 100644
--- a/package.json
+++ b/package.json
@@ -25,18 +25,18 @@
"dependencies": {
"form-data-to-object": "^0.1.0"
},
- "peerDependencies": {
- "react": "^0.14.0-beta1"
- },
"devDependencies": {
"babel": "^5.6.4",
"babel-core": "^5.1.11",
"babel-loader": "^5.0.0",
"jasmine-node": "^1.14.5",
"jsdom": "^3.1.2",
- "react": "^0.14.0-beta1",
- "react-dom": "^0.14.0-beta1",
+ "react": "^0.14.0-beta3",
+ "react-dom": "^0.14.0-beta3",
"webpack": "^1.7.3",
"webpack-dev-server": "^1.7.0"
+ },
+ "peerDependencies": {
+ "react": "^0.14.0-beta3"
}
}
diff --git a/specs/Element-spec.jsx b/specs/Element-spec.jsx
index ec2d3f2..d09746d 100644
--- a/specs/Element-spec.jsx
+++ b/specs/Element-spec.jsx
@@ -198,8 +198,11 @@ describe('Element', function() {
it('should allow an undefined value to be updated to a value', function (done) {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
+ changeValue: function (event) {
+ this.setValue(event.target.value);
+ },
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
@@ -237,7 +240,7 @@ it('should allow an undefined value to be updated to a value', function (done) {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
@@ -264,7 +267,7 @@ it('should allow an undefined value to be updated to a value', function (done) {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
@@ -368,7 +371,7 @@ it('should allow an undefined value to be updated to a value', function (done) {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
@@ -394,7 +397,7 @@ it('should allow an undefined value to be updated to a value', function (done) {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
@@ -428,7 +431,7 @@ it('should allow an undefined value to be updated to a value', function (done) {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
@@ -459,7 +462,7 @@ it('should allow an undefined value to be updated to a value', function (done) {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
diff --git a/specs/Formsy-spec.jsx b/specs/Formsy-spec.jsx
index 5d51f43..d9d67fa 100755
--- a/specs/Formsy-spec.jsx
+++ b/specs/Formsy-spec.jsx
@@ -84,7 +84,7 @@ describe('Formsy', function () {
// Wait before adding the input
setTimeout(function () {
- inputs.push();
+ inputs.push();
forceUpdate(function () {
// Wait for next event loop, as that does the form
@@ -135,7 +135,7 @@ describe('Formsy', function () {
// Wait before adding the input
setTimeout(function () {
- inputs.push();
+ inputs.push();
forceUpdate(function () {
@@ -378,7 +378,7 @@ describe('Formsy', function () {
);
// Wait before adding the input
- inputs.push();
+ inputs.push();
forceUpdate(function () {
@@ -401,7 +401,7 @@ describe('Formsy', function () {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
@@ -439,7 +439,7 @@ describe('Formsy', function () {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return ;
+ return ;
}
});
var TestForm = React.createClass({
@@ -494,7 +494,7 @@ describe('Formsy', function () {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return ;
+ return ;
}
});
var TestForm = React.createClass({
@@ -524,7 +524,7 @@ describe('Formsy', function () {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return ;
+ return ;
}
});
var TestForm = React.createClass({
diff --git a/specs/Validation-spec.jsx b/specs/Validation-spec.jsx
index cf92542..fd6fabe 100644
--- a/specs/Validation-spec.jsx
+++ b/specs/Validation-spec.jsx
@@ -160,7 +160,7 @@ describe('Validation', function() {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
@@ -191,7 +191,7 @@ describe('Validation', function() {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
@@ -223,7 +223,7 @@ describe('Validation', function() {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
@@ -253,7 +253,7 @@ describe('Validation', function() {
var TestInput = React.createClass({
mixins: [Formsy.Mixin],
render: function () {
- return
+ return
}
});
var TestForm = React.createClass({
diff --git a/src/main.js b/src/main.js
index 8c2e345..b8e9bfe 100644
--- a/src/main.js
+++ b/src/main.js
@@ -393,17 +393,15 @@ Formsy.Form = React.createClass({
// Validate the form by going through all child input components
// and check their state
validateForm: function () {
- var allIsValid = true;
+ var allIsValid;
var inputs = this.inputs;
var inputKeys = Object.keys(inputs);
// We need a callback as we are validating all inputs again. This will
// run when the last component has set its state
var onValidationComplete = function () {
- inputKeys.forEach(function (name) {
- if (!inputs[name].state._isValid) {
- allIsValid = false;
- }
+ allIsValid = inputKeys.every(function (name) {
+ return inputs[name].state._isValid;
}.bind(this));
this.setState({