Skip to main content

Search and Top Navigation

#5782 closed bug (worksforme)

Opened June 29, 2010 10:06PM UTC

Closed July 07, 2010 01:38PM UTC

Last modified October 11, 2012 09:15PM UTC

Clicking on slider with negative values causes error 'closestHandle is undefined'

Reported by: Thangalin Owned by:
Priority: major Milestone:
Component: ui.slider Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:
Description

If you *RECREATE* a slider with min: -2, max: 0, value: 0 then click on the slider, the following error occurs:

closestHandle is undefined

The line in question:

closestHandle

.addClass( "ui-state-active" )

.focus();

Attachments (0)
Change History (7)

Changed June 29, 2010 10:11PM UTC by Thangalin comment:1

Inserting a line after the workaround for but 3736:

alert( "index: " + index +

" @0:" + this.values(0) +

" @1:" + this.values(1) );

Reveals:

index: undefined @0:-65 @1:50

Changed June 29, 2010 10:40PM UTC by Thangalin comment:2

It appears the function normValueFromMouse is returning a value of -65115 when it should return 50 (when clicking on the right-most slider whose value is 50 and left-most slider whose value is -65).

Changed June 29, 2010 10:45PM UTC by Thangalin comment:3

Line 432: valueMouse = this._valueMin() + percentMouse * valueTotal;

valueMouse should be 48, but it is -65115.

Changed June 29, 2010 10:54PM UTC by Thangalin comment:4

I changed the following lines to use parseInt:

_valueMin: function() {

return parseInt( this.options.min );

},

_valueMax: function() {

return parseInt( this.options.max );

},

I think negative values were treated as strings, when added as follows:

$.each( data, function( index, value ) {

options.push(

'<option value="' + value + '">' + value + '</option>' );

Changed June 29, 2010 11:02PM UTC by Thangalin comment:5

Also, the source code comment in the documentation for the UI Slider should begin with "/*!" not "/*" (i.e., append a bang) to preserve the copyright information in the minified version. *OR* remove the bang from everywhere else. Either way, it should be consistent. And this should be in a different bug. ;-)

Changed July 07, 2010 01:38PM UTC by scottgonzalez comment:6

resolution: → worksforme
status: newclosed

I'm not seeing any problems: http://jsbin.com/epowu3

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:7

milestone: TBD

Milestone TBD deleted