From 27ab4f17c54232d26ba4c90f07038e5120ba81a5 Mon Sep 17 00:00:00 2001 From: Stelios Manousopoulos Date: Mon, 16 Oct 2017 15:14:15 +0300 Subject: [PATCH] pass cleared values to validate callback --- lib/index.js | 2 +- src/index.jsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/index.js b/lib/index.js index b75fd1f..a0315f0 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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) { diff --git a/src/index.jsx b/src/index.jsx index 18d4ca8..f2feea9 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -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; }); }