mirror of
https://github.com/wassname/slider.git
synced 2026-09-09 11:35:22 +08:00
Sending new value to _start while dragging
This commit is contained in:
+4
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user