Skip to content

Commit

Permalink
fix(range): 修复使用 step 时未考虑 min 值的处理 (#3111)
Browse files Browse the repository at this point in the history
Co-authored-by: daiwanxing <[email protected]>
  • Loading branch information
daiwanxing and daiwanxing authored Jul 2, 2024
1 parent 69f9bc5 commit 22fc347
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/packages/__VUE/range/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export default create({
const format = (value: number) => {
const { min, max, step } = props
value = Math.max(+min, Math.min(value, +max))
return Math.round(value / +step) * +step
return Math.round((value - +min) / +step) * +step + +min
}
const isSameValue = (newValue: SliderValue, oldValue: SliderValue) =>
Expand Down

0 comments on commit 22fc347

Please sign in to comment.