From 3d1fe21808757624461e17cb9a50b5b1ca1e23e7 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: Mon, 16 Oct 2023 14:47:21 +0300 Subject: [PATCH] Fixed #4625 - Slider: step defect --- 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 46e501816..a5d81ead2 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.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; + 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; } else { newValue = Math.floor(newValue); }