Correct steps calculation

This commit is contained in:
Sergio Crisostomo 2018-01-30 10:24:29 +01:00
parent 965b6d8e41
commit eb8c6cd9b3

View file

@ -254,11 +254,9 @@
if (type === 'min') newPos = this.checkLimits([newPos, this.maxPosition])[0];
else newPos = this.checkLimits([this.minPosition, newPos])[1];
const lengthPerStep = this.valueRange / 100 * this.step;
const steps = Math.round(newPos / lengthPerStep);
const modulus = newPos % this.step;
const value = this.currentValue;
value[index] = Math.round(steps * lengthPerStep);
value[index] = newPos - modulus;
this.currentValue = [...value];
if (!this.dragging) {