Merge pull request #3291 from miomio-xiao/2.0
fix Slider not emit on-change event when click bar at first time
This commit is contained in:
commit
0e6b84f379
1 changed files with 3 additions and 2 deletions
|
@ -151,7 +151,7 @@
|
||||||
startX: 0,
|
startX: 0,
|
||||||
currentX: 0,
|
currentX: 0,
|
||||||
startPos: 0,
|
startPos: 0,
|
||||||
oldValue: val,
|
oldValue: [...val],
|
||||||
valueIndex: {
|
valueIndex: {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 1,
|
max: 1,
|
||||||
|
@ -331,6 +331,7 @@
|
||||||
const value = this.currentValue;
|
const value = this.currentValue;
|
||||||
value[index] = newPos - modulus;
|
value[index] = newPos - modulus;
|
||||||
this.currentValue = [...value];
|
this.currentValue = [...value];
|
||||||
|
|
||||||
if (!this.dragging) {
|
if (!this.dragging) {
|
||||||
if (this.currentValue[index] !== this.oldValue[index]) {
|
if (this.currentValue[index] !== this.oldValue[index]) {
|
||||||
this.emitChange();
|
this.emitChange();
|
||||||
|
|
Loading…
Add table
Reference in a new issue