New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default value calculation error #338
Comments
Also, even if I set value after initializing,then updating the slider with 'update',true the value still having the calculated value. |
@grajendran-cricut here is a really basic example and for me everything looks like expected here. |
@andreruffert , As per the rangeslider documentation, it will set 2000 as default value. Next, on some event I am programmatically setting min,max,value from db using jquery like below I noticed that min and max are getting updated right, but the value is set as a different value. the slider is setting 200 for value.(which i could not understand). I tried to destroy and initialize again it did not worked. I tried to set prop('value') but still it is not updating. Next, without moving the slider at all, i try to read the default value, but it is returned as 210 which is 70 + (350-70)/2 = 70 + 140 When I move the slider, the values are getting updated and returns right value. |
Here is another example for programatic attribute + value changes. |
let me check that too |
@andreruffert , Just noticed that this got closed. I got into other issues and restarted the slider changes from last week and noticed that issue is re-appearing. It is similar to https://codepen.io/andreruffert/pen/qdWWZP I just set the value randomly and tried to fetch the value. As per my understanding, the value that I have set should be returned but it returns different value Am I doing anything wrong here? In other words, how can I set the value attribute to be something different that min + max-min/2 calculated value during initialization |
@grajendran-cricut in your example you have set these element attributes:
Now if you set a value to be The Does this make sense? |
@andreruffert , thanks for the update so quickly. In this example, the value will be 50 by default/calculated. Is it possible that I can set to different value(say 40) during initialization. By the same logic described above with step = 10, will it go to 30 or 20 when we try to set the value between 20 - 25 and 25-30. Sorry to ask these questions, I have used the slider and I want to know the cause/reason so that I can prepare myself for bugs. |
I have used rangeslider and as per the documentation, the value is set to default by min + (max-min)/2;
However if I have min=100, max=350, as per this calculation it should have set 225 but my slider having 230?
100 + (350-100)/2 => 100 + 125 => 225
I tried to apply ceil/round etc but I could not fin how range slider got this value of 230?
The text was updated successfully, but these errors were encountered: