Skip to content

Commit

Permalink
Fixed #4577 - Cannot click to select min or max value when using slid…
Browse files Browse the repository at this point in the history
…er with step property
  • Loading branch information
tugcekucukoglu committed Oct 10, 2023
1 parent 1aa75ae commit 8e62b10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/slider/Slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export default {
const oldValue = this.range ? this.modelValue[this.handleIndex] : this.modelValue;
const diff = newValue - oldValue;
if (diff < 0) newValue = oldValue + Math.ceil(newValue / this.step - oldValue / this.step) * this.step;
else if (diff > 0) newValue = oldValue + Math.floor(newValue / this.step - oldValue / this.step) * this.step;
if (diff < 0) newValue = oldValue + Math.floor(newValue / this.step - oldValue / this.step) * this.step;
else if (diff > 0) newValue = oldValue + Math.ceil(newValue / this.step - oldValue / this.step) * this.step;
} else {
newValue = Math.floor(newValue);
}
Expand Down

0 comments on commit 8e62b10

Please sign in to comment.