From e7007fbe8e7bfa83fb12f6d8b72c845cb8e0a958 Mon Sep 17 00:00:00 2001 From: Daniel Osorio Date: Thu, 27 Aug 2015 19:23:57 -0500 Subject: [PATCH] Sending new value to _start while dragging --- src/Slider.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Slider.jsx b/src/Slider.jsx index 677bfea..9a74914 100644 --- a/src/Slider.jsx +++ b/src/Slider.jsx @@ -164,7 +164,7 @@ const Slider = React.createClass({ const position = this._getTouchPosition(e); const value = this._calValueByPos(position); this._triggerEvents('onChange', value); - this._start(position); + this._start(position, value); this._addDocumentEvents('touch'); pauseEvent(e); }, @@ -173,7 +173,7 @@ const Slider = React.createClass({ const position = e.pageX || (e.clientX + document.documentElement.scrollLeft); // to compat ie8 const value = this._calValueByPos(position); this._triggerEvents('onChange', value); - this._start(position); + this._start(position, value); this._addDocumentEvents('mouse'); pauseEvent(e); }, @@ -468,9 +468,9 @@ const Slider = React.createClass({ } }, - _start(position) { + _start(position, value) { this._triggerEvents('onBeforeChange'); - this.startValue = this.state.value; + this.startValue = value; this.startPosition = position; this.setState({ dragging: true,