ui-slider
ui-slider copied to clipboard
Should the input step its value
We need to review the stepping of values.
See the second example on the demo page - the slider increases 5 steps when changing the value of the input from 2 to 3. Apparently the slider is cieling the value and correctly snaps the slider handle to next coming value. However the value of the input isn't changing. Perhaps the value of the input should step as well?
That may be considered a validation pattern or something. I'm not sure why the slider moves at all with invalid values though.
I believe the value of the slider is rounded in order to snap to the steps. In the second example with step 5 set, if one drags the slider handle just above where 3 is suppose to be, the handle snaps to value 5 and on the other hand if one drags the handle just below 3 it snaps to 0. That would make sense why the handle is moving at odd values.
In the jquery ui slider source it most likely is the method at row 514, _trimAlignValue, that is responsible for this. https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.slider.js
Or did you mean something else that is broken?
// John
On 20130704,, at 0:25 , Dean Sofer wrote:
That may be considered a validation pattern or something. I'm not sure why the slider moves at all with invalid values though.
— Reply to this email directly or view it on GitHub.