ui-slider icon indicating copy to clipboard operation
ui-slider copied to clipboard

Should the input step its value

Open johnparn opened this issue 12 years ago • 2 comments

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?

johnparn avatar Jul 03 '13 09:07 johnparn

That may be considered a validation pattern or something. I'm not sure why the slider moves at all with invalid values though.

ProLoser avatar Jul 03 '13 22:07 ProLoser

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.

johnparn avatar Jul 04 '13 06:07 johnparn