We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1a4ba39 + 72a8229 commit 7a16457Copy full SHA for 7a16457
react-slider.js
@@ -491,11 +491,13 @@
491
zIndices.splice(zIndices.indexOf(i), 1); // remove wherever the element is
492
zIndices.push(i); // add to end
493
494
- this.setState({
495
- startValue: this.state.value[i],
496
- startPosition: position,
497
- index: i,
498
- zIndices: zIndices
+ this.setState(function (prevState) {
+ return {
+ startValue: this.state.value[i],
+ startPosition: position !== undefined ? position : prevState.startPosition,
+ index: i,
499
+ zIndices: zIndices
500
+ };
501
});
502
},
503
0 commit comments