#5782 closed bug (worksforme)
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();
Change History (7)
comment:1 follow-up: 3 Changed 13 years ago by
comment:2 Changed 13 years ago by
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).
comment:3 Changed 13 years ago by
Line 432: valueMouse = this._valueMin() + percentMouse * valueTotal;
valueMouse should be 48, but it is -65115.
comment:4 Changed 13 years ago by
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>' );
comment:5 Changed 13 years ago by
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. ;-)
comment:6 Changed 13 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I'm not seeing any problems: http://jsbin.com/epowu3
Inserting a line after the workaround for but 3736:
Reveals: