From 8e62b10c3c05e857a6c79c885a51383e4995295f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 10 Oct 2023 17:53:11 +0300 Subject: [PATCH] Fixed #4577 - Cannot click to select min or max value when using slider with step property --- components/lib/slider/Slider.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/slider/Slider.vue b/components/lib/slider/Slider.vue index a5d81ead2..46e501816 100755 --- a/components/lib/slider/Slider.vue +++ b/components/lib/slider/Slider.vue @@ -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); }