Opened 9 years ago

Closed 7 years ago

#6718 closed bug (wontfix)

Slider handle shows min value when min and max are identical

Reported by: be.davestein Owned by:
Priority: minor Milestone: 1.11.0
Component: ui.slider Version: 1.8.6
Keywords: Cc:
Blocked by: Blocking:

Description

I have two sliders that increase the size of two divs in a confined space. So if the space is 100, and Slider A is 40, Slider B can be 0-60.

The problem arises when Slider A is moved to 100. Slider B then has a min and max of 0. Here is the line from the plug-in that is error'ing:

valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100;

It will make 0 divide by 0 which is obviously not good. I'd suggest adding a guard to set the value percent 100 in this case, since the max value has been hit. Otherwise it seems like the slider should be able to move to the right, which is incorrect.

Real random use case, I know.

Change History (2)

comment:1 Changed 7 years ago by Scott González

Milestone: 1.9.01.11.0

comment:2 Changed 7 years ago by tj.vantoll

Resolution: wontfix
Status: newclosed

As of version 1.9 there is no JS error for this situation and the slider handles are not moveable - http://jsfiddle.net/tj_vantoll/3FMry/. Beyond that there's nothing the core library is going to be able to do to handle a min and max of 0.

Note: See TracTickets for help on using tickets.