sliders: steps error (#835)

This commit is contained in:
jean-emmanuel 2023-11-23 09:38:15 +01:00
parent a6237a0aac
commit e4db027085
4 changed files with 8 additions and 5 deletions

View file

@ -242,7 +242,7 @@ class Slider extends Canvas {
} else if (typeof steps === 'number' && Math.round(steps) > 0) {
steps = Math.round(steps)
this.steps = Array(steps).fill(0).map((x, i) => i / (steps - 1) * (this.rangeValsMax - this.rangeValsMin) + this.rangeValsMin)
} else if (Array.isArray(steps) && step.every(x=>typeof x === 'number')) {
} else if (Array.isArray(steps) && steps.every(x=>typeof x === 'number')) {
this.steps = steps
} else {
this.steps = null