Addendum to #252: Moving a slider handle to the left/right does not result in the minimum/maximum value #292

Closed
opened 2026-01-29 17:34:51 +00:00 by claunia · 3 comments
Owner

Originally created by @PhilippJR on GitHub (Jan 10, 2022).

Describe the bug
Same like in issue #252:
When moving a slider handle to the left, it does mostly not stop at the minimum value.
When moving a slider handle to the right, it does mostly not stop at the maximum value.

To Reproduce

  1. Go to https://blazor.radzen.com/slider
  2. Move the mouse with clicked "Slider from 0 to 100" handle quickly beyond the left/right border. The minimum is always 0. The maximum is always 100. --> This works well.
  3. Move the mouse with clicked "Range Slider" left/right handle quickly beyond the left/right border. The minimum is always 0. The maximum is always 100. --> This works well.
  4. In the source code, change
    IEnumerable<int> values = new int[] { 14, 78 };
    to
    IEnumerable<int> values = new int[] { 0, 100 };
    and
    int value = 67;
    to
    int value = 0;
  5. Repeat steps 2 and 3. The handles now do not stop at minimum and maximum when the mouse is moved quickly beyond the borders.

Expected behavior
Even when moving the mouse quickly far over the boundary the handle value should be the minimum/maximum.

Screenshots
(I added 2 spans to display the handle positions.)
I moved the mouse with clicked slider handle quickly beyond the left border and the handle stopped far before the min value.
I moved the mouse with clicked range slider left/right handle quickly beyond the left/right border and the handles stopped at 9 and 94.
image

Desktop
OS: Windows 11
Browser: Chrome 97.0.4692.71, Edge 97.0.1072.55, Firefox 95.0.2

Additional context
This also explains my comment on fix 5470222 because the start values of "Range Slider with negative values" are the min and max value.

Originally created by @PhilippJR on GitHub (Jan 10, 2022). **Describe the bug** Same like in issue #252: When moving a slider handle to the left, it does mostly not stop at the minimum value. When moving a slider handle to the right, it does mostly not stop at the maximum value. **To Reproduce** 1. Go to https://blazor.radzen.com/slider 2. Move the mouse with clicked "Slider from 0 to 100" handle quickly beyond the left/right border. The minimum is always 0. The maximum is always 100. --> This works well. 3. Move the mouse with clicked "Range Slider" left/right handle quickly beyond the left/right border. The minimum is always 0. The maximum is always 100. --> This works well. 4. In the source code, change `IEnumerable<int> values = new int[] { 14, 78 };` to `IEnumerable<int> values = new int[] { 0, 100 };` and `int value = 67;` to `int value = 0;` 5. Repeat steps 2 and 3. The handles now do not stop at minimum and maximum when the mouse is moved quickly beyond the borders. **Expected behavior** Even when moving the mouse quickly far over the boundary the handle value should be the minimum/maximum. **Screenshots** (I added 2 spans to display the handle positions.) I moved the mouse with clicked slider handle quickly beyond the left border and the handle stopped far before the min value. I moved the mouse with clicked range slider left/right handle quickly beyond the left/right border and the handles stopped at 9 and 94. ![image](https://user-images.githubusercontent.com/81237852/148739258-7524128e-777b-4346-ae91-2a13ae2cf386.png) **Desktop** OS: Windows 11 Browser: Chrome 97.0.4692.71, Edge 97.0.1072.55, Firefox 95.0.2 **Additional context** This also explains my [comment on fix 5470222](https://github.com/radzenhq/radzen-blazor/commit/547022249651ab7ceeca8f2393879281b18dada7#commitcomment-58199196) because the start values of "Range Slider with negative values" are the min and max value.
Author
Owner

@jahnotto commented on GitHub (Oct 16, 2022):

I'm still seeing the same issue. It's easy to reproduce -- you can observe this in the "Range Slider with negative values" slider on https://blazor.radzen.com/slider.

Any updates on this one?

@jahnotto commented on GitHub (Oct 16, 2022): I'm still seeing the same issue. It's easy to reproduce -- you can observe this in the "_Range Slider with negative values_" slider on https://blazor.radzen.com/slider. Any updates on this one?
Author
Owner

@PhilippJR commented on GitHub (Oct 17, 2022):

I can confirm, that this bug still exists. It only occurs, when the handle's start values are at minimum/maximum value.

Here's a workaround, that I use:
private const double _bugOffset = 0.001;
currentMinHandleValue = foo; // set min handle position
currentMaxHandleValue = bar; // set max handle position
_rangeSliderMinimum = foo - _bugOffset; // but set possible minimum to a little smaller value
_rangeSliderMaximum = bar + _bugOffset;

@PhilippJR commented on GitHub (Oct 17, 2022): I can confirm, that this bug still exists. It only occurs, when the handle's start values are at minimum/maximum value. Here's a workaround, that I use: `private const double _bugOffset = 0.001;` `currentMinHandleValue = foo; // set min handle position` `currentMaxHandleValue = bar; // set max handle position` `_rangeSliderMinimum = foo - _bugOffset; // but set possible minimum to a little smaller value` `_rangeSliderMaximum = bar + _bugOffset;`
Author
Owner

@enchev commented on GitHub (Oct 24, 2023):

Fixed in 1dc1c99c33

@enchev commented on GitHub (Oct 24, 2023): Fixed in https://github.com/radzenhq/radzen-blazor/commit/1dc1c99c33923b102d3ee263554d38bb660b890d
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#292