Skip to content

Commit

Permalink
pass cleared values to validate callback
Browse files Browse the repository at this point in the history
  • Loading branch information
smanousopoulos committed Oct 16, 2017
1 parent dd65796 commit 27ab4f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ var createWizard = function createWizard() {
var validate = item.props.validate;

return Promise.resolve().then(function () {
return validate(value);
return validate(value, _this4._getClearedValues());
}).then(function () {
_this4._setValidationClear(id);return value;
}).catch(function (err) {
Expand Down
6 changes: 3 additions & 3 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@ const createWizard = (WizardItemWrapper=null) => {

this.setState({ active: id });
}

//handle event functions
_validate(id, value) {
_validate(id, value) {
const item = this._getWizardItem(id);
const { validate } = item.props;
return Promise.resolve()
.then(() => validate(value))
.then(() => validate(value, this._getClearedValues()))
.then(() => { this._setValidationClear(id); return value; })
.catch((err) => { this._setValidationFail(id, err); throw err; });
}
Expand Down

0 comments on commit 27ab4f1

Please sign in to comment.