Opened 5 years ago

Last modified 21 months ago

#9924 open bug

Slider: Odd value when sliding past min/max value, only when 'step' represents < 1px

Reported by: janicki Owned by:
Priority: minor Milestone: none
Component: ui.slider Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:


JSFiddle example:

The example link above explains the problem succinctly. Below is just my use case to explain why increasing the step value to represent >= 1px is not an ideal work-around.

My app's slider represents a time range over several months. I want the step to be minutes. Understandably, dragging the handle one pixel changes the value multiple minutes (since there aren't enough pixels to represent every step), but using the keyboard arrows moves per my 1-minute steps. This works as desired: quick moves via mouse, and fine control via keyboard.

On Firefix, the odd behavior is when the handle is at the max. Then, if you click and drag the handle to the right by exactly one pixel, the slider's value goes to less than max. Sliding further to the right pegs at max, as expected. On Safari, the error is on the min side. Looks like a float rounding error?

It's obviously a minor issue, but my users often scroll to/from the max value, and my app appears jittery there. (My workaround will be a separate control for fine adjustments, so I can keep the step value >= 1px.)

Change History (3)

comment:1 Changed 5 years ago by tj.vantoll

Status: newopen
Summary: Odd slider value when sliding past min/max value, only when 'step' represents < 1pxSlider: Odd value when sliding past min/max value, only when 'step' represents < 1px

I can't recreate any issues in Chrome but I can in Firefox. This is likely a subpixel issue.

comment:2 Changed 21 months ago by Michael Quad

could not to repeat the problem on Firefox 49 and Chrome 54..

comment:3 Changed 21 months ago by Scott González

This is still reproducible. Make sure you follow the instructions in the fiddle exactly.

Note: See TracTickets for help on using tickets.