Fixed #4577 - Cannot click to select min or max value when using slider with step property
parent
1aa75aef2b
commit
8e62b10c3c
|
@ -102,8 +102,8 @@ export default {
|
||||||
const oldValue = this.range ? this.modelValue[this.handleIndex] : this.modelValue;
|
const oldValue = this.range ? this.modelValue[this.handleIndex] : this.modelValue;
|
||||||
const diff = newValue - oldValue;
|
const diff = newValue - oldValue;
|
||||||
|
|
||||||
if (diff < 0) newValue = oldValue + Math.ceil(newValue / this.step - oldValue / this.step) * this.step;
|
if (diff < 0) newValue = oldValue + Math.floor(newValue / this.step - oldValue / this.step) * this.step;
|
||||||
else if (diff > 0) newValue = oldValue + Math.floor(newValue / this.step - oldValue / this.step) * this.step;
|
else if (diff > 0) newValue = oldValue + Math.ceil(newValue / this.step - oldValue / this.step) * this.step;
|
||||||
} else {
|
} else {
|
||||||
newValue = Math.floor(newValue);
|
newValue = Math.floor(newValue);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue