MudBlazor.Extensions icon indicating copy to clipboard operation
MudBlazor.Extensions copied to clipboard

[Bug]: Funny behaviour using MudExRangeSlider

Open mpallesen opened this issue 4 months ago • 1 comments

Contact Details

[email protected]

What happened?

Hi

I like the component, but it has issues. There is something about the dragging thats off.

In my case, I have: Min = 0 Max = 10 Initial start/min value = 4 Initial end/max value = 10 Min span value = 4 Max span value = 10 Step size = 2

Initially all is good, but when i start dragging min towards the max, it goes from 4 to 6 and then from 6 to 8. This is already wrong, but if i continue to drag towards 10, it then jumps back to 6 (which is correct).

Further, on the demo page https://www.mudex.org/range-slider I can make the browser to go unresponsive. If you make the browser window 1200 px wide (including the left side menu) Go to example nr. 2. Drag the left/min onto the right/max, the browser becomes unresponsive.

I have spend a lot of hours trying to find a solution but I cant find one.

Maybe the issues are linked..

Michael

Expected Behavior

I expect that the my min span of 4 is respected, so my min/left thumb can never reach 8.

Screenshots

No response

Reproduction link

No response

What application type are you referring to?

Please select an application type...

Custom Application Type

No response

MudBlazor.Extension Version

8.15

MudBlazor Version

8.15

What .net Version are you using?

.Net8

What browser are you using?

Chrome

Sample Solution

ShowInputs="true" Size="@Size.Large" SizeRange="@_sizeRange" StepLength="@_stepLength" MinLength="@_minLength" MaxLength="@_maxLength" @bind-Value="_selectedRange" AllowWholeRangeDrag="true" Immediate="true" />

@code {

[Parameter] public bool Disabled { get; set; }

private IRange<long> _selectedRange = new MudExRange<long>(0);
private MudExRange<long>? _sizeRange;
private RangeLength<long> _stepLength;
private RangeLength<long> _minLength;
private RangeLength<long> _maxLength;

protected override Task OnInitializedAsync()
{
    Console.WriteLine("FeatureFilterSpanInt.OnInitializedAsync");
    
    var minValue = 0;
    var maxValue = 10;
    var minSpan = 4;
    var maxSpan = 8;
    var increment = 2;
    var initialLowValue = 4;
    var initialSpan =6;
    var initialHighValue = initialLowValue + initialSpan;
    
    Console.WriteLine("initialSpan: " + initialSpan);
    Console.WriteLine("minValue: " + minValue + " maxValue: " + maxValue + " minSpan: " + minSpan + " maxSpan: " + maxSpan + " increment: " + increment);
    
    _sizeRange = new MudExRange<long>(minValue, maxValue);
    _stepLength = new RangeLength<long>(increment);
    
    var math = new NumericRangeMath<long>();
    _minLength = new RangeLength<long>(minSpan, math);
    _maxLength = new RangeLength<long>(maxSpan,math);
    
    Console.WriteLine("low: " + initialLowValue + " high: " + initialHighValue + "");
    _selectedRange = new MudExRange<long>(initialLowValue, initialHighValue);

    return base.OnInitializedAsync();
}

}

Pull Request

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

mpallesen avatar Dec 22 '25 08:12 mpallesen

youre right. I was able to reproduce. https://try.mudex.org/snippet/QEcpPwQwLvjWUIgl

Looks like there is something not correctly working. Anyhow I will try to fix that

fgilde avatar Dec 22 '25 20:12 fgilde