Skip to main content

Search and Top Navigation

#6718 closed bug (wontfix)

Opened December 03, 2010 09:43PM UTC

Closed October 15, 2012 06:30PM UTC

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.

Attachments (0)
Change History (2)

Changed October 11, 2012 02:53PM UTC by scottgonzalez comment:1

milestone: 1.9.01.11.0

Changed October 15, 2012 06:30PM UTC by tj.vantoll comment:2

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.