Sending new value to _start while dragging

This commit is contained in:
Daniel Osorio
2015-08-27 19:23:57 -05:00
parent 8f490c80be
commit e7007fbe8e
+4 -4
View File
@@ -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,