Blazorise icon indicating copy to clipboard operation
Blazorise copied to clipboard

Slider component not initializing as expected with values over 100.

Open DarthPedro opened this issue 6 years ago • 5 comments

Describe the bug When you set Slider.Value to a number greater than 100 during initial binding, it gets trimmed to 100 (even when the Max is much higher).

To Reproduce Steps to reproduce the behavior:

  1. Create a Slider with the following: <Slider TValue="int" Min="10" Max="1000" Value="900" Step="5" Class="slider">Cool slider</Slider>

  2. Click F5 and start your app.

  3. Notice the slider thumb is displayed at a lower value (looks like about where 100 would be). But it's Value property is correct.

  4. If you use the slider, it will move up past that value and up to the Max.

Expected behavior The slider should start about 90% through the slider (near the right end). But it stays at about 100 (about 10%).

Additional context Note: This works fine if the value range is between 1 through 100, like: Cool slider When you launch the app now, the slider is at the right position (90).

DarthPedro avatar Apr 04 '20 03:04 DarthPedro

I can reproduce it on my side also. Definitely a bug. So far I cannot see where's the problem. Min and Max is set and Value is parsed just as it should be. No reason to act like this.

stsrki avatar Apr 04 '20 08:04 stsrki

Yeah, it is very weird. I tried the same with input range in html directly and that worked as expected. I didn't see anything in the Slider class that did anything different. Is there some javascript that could be doing that?

DarthPedro avatar Apr 04 '20 17:04 DarthPedro

Unless bootstrap itself is doing something, then no, there is no javascript for Slider component.

I tried everything so far, removed every attribute one by one, tried diferent combination of value, min, max and other attributes. It works on random so I really cannot figure what is going on. Slider is actually the easiest component on Blazorise. Really weird...

Maybe I should see if Bootstrap is doing something 🤔

stsrki avatar Apr 04 '20 19:04 stsrki

I am using the Blazorise.Bootstrap package, so maybe... I agree it is very, very weird.

DarthPedro avatar Apr 04 '20 21:04 DarthPedro

Fixed by @MitchellNZ

stsrki avatar Apr 14 '20 07:04 stsrki