Skip to content

Commit

Permalink
fix(QSlider/QRange): slider value should start from innerMin instea…
Browse files Browse the repository at this point in the history
…d of `min` on drag #16614 (#16615)

* Fix slider conversion

* Clamp ratio

* Update use-slider.js

---------

Co-authored-by: Razvan Stoenescu <[email protected]>
  • Loading branch information
Tofandel and rstoenescu authored Nov 29, 2023
1 parent 1c51a70 commit fca9331
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/src/components/slider/use-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
let model = min + ratio * (max - min)

if (step > 0) {
const modulo = (model - min) % step
const modulo = (model - innerMin.value) % step
model += (Math.abs(modulo) >= step / 2 ? (modulo < 0 ? -1 : 1) * step : 0) - modulo
}

Expand Down

0 comments on commit fca9331

Please sign in to comment.