From 1dfc967900a983166ac5fae87d5c06878278492d Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Wed, 20 Nov 2024 14:08:21 +0200 Subject: [PATCH] Slider step not working properly when equal to min --- Radzen.Blazor/wwwroot/Radzen.Blazor.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Radzen.Blazor/wwwroot/Radzen.Blazor.js b/Radzen.Blazor/wwwroot/Radzen.Blazor.js index 791a28a023b..483724b6849 100644 --- a/Radzen.Blazor/wwwroot/Radzen.Blazor.js +++ b/Radzen.Blazor/wwwroot/Radzen.Blazor.js @@ -483,7 +483,13 @@ window.Radzen = { var percent = isVertical ? (parent.offsetHeight - handle.offsetTop - offsetY) / parent.offsetHeight : (Radzen.isRTL(handle) ? parent.offsetWidth - handle.offsetLeft - offsetX : handle.offsetLeft + offsetX) / parent.offsetWidth; - var newValue = Math.max(min, Math.min(percent, max)) * (max - min) + min; + if (percent > 1) { + percent = 1; + } else if (percent < 0) { + percent = 0; + } + + var newValue = percent * (max - min) + min; if ( slider.canChange &&