Skip to content

Commit

Permalink
fix(range): 修复使用 step 时未考虑 min 值的处理
Browse files Browse the repository at this point in the history
  • Loading branch information
daiwanxing committed Jun 27, 2024
1 parent c98a1ee commit dd9c85f
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 dd9c85f

Please sign in to comment.