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.
1 parent 8343801 commit 98f01b5Copy full SHA for 98f01b5
src/range-slider-element.js
@@ -373,7 +373,9 @@ export class RangeSliderElement extends HTMLElement {
373
const safeValue = Math.min(Math.max(value, thumbMinValue), thumbMaxValue);
374
375
// Rounding in steps
376
- const nearestValue = Math.round(safeValue / this.step) * this.step;
+ const offset = safeValue - this.min;
377
+ const nearestOffset = Math.round(offset / this.step) * this.step;
378
+ const nearestValue = this.min + nearestOffset;
379
380
// Value precision
381
const newValue = Number(
0 commit comments