Custom Query (7259 matches)


Show under each result:

Results (103 - 105 of 7259)

Ticket Resolution Summary Owner Reporter
#10719 notabug ui.slider: Percentage value of handle in 1.11.2 is wrong simeydotme

Since upgrading to 1.11.2 I've noticed a problem since I maintain a plugin which adds pips to the slider... and the pips are now not aligning with the handles. I looked in to it and actually it seems the left: x% values changed since 1.11.2. I hope it is a bug as it was not mentioned in the changelog as a intended change. <-- jqueryui 1.11.1 <-- jqueryui 1.11.2

in the JSFiddles I have echoed out the style attribute; you can see they are different and they get gradually more and more different down the slider.

also it is now impossible to get the "max" value with this setup, as demonstrated if you try to slide to the end.

#2589 fixed ui.slider.js range problem getting handle values joern norbert

I am using the latest ui.slider.js (revision 5107) and have created a slider with two handles and a range:

$("#MyDiv").slider( {

'range': true, 'stepping': 1, 'minValue': 1, 'maxValue': 10, 'startValue': [1,10], 'stop': function(){

console.debug( $(this).slider('value') );


} );

Everything works fine until I move one of the handles. The console.debug statement in my stop event listener reported the correct value. However, if I try to retrieve the value of the range handles to send to the server using $("#MyDiv").slider('value', 0) or $("#MyDiv").slider('value', 1), I always got a very unhelpful JavaScript error:

Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)", etc.

This error can be reproduced quite easily in the jQuery UI slider demo page (type $('#example3').slider('value', 0) in FireBug after loading the page).

I have patiently debugged the error and have located the problem in line 173 of the ui.slider.js (revision 5107):

var value = ((parseInt($(handle != undefined ? this.handle[handle]
handle : this.currentHandle).css([0]),10) /

(this.size() - this.handleSize())) * this.options.realMaxValue) + this.options.minValue;

Since the this.handle array length is 2, line 172 does not set the this.currentHandle:

if(this.handle.length == 1) this.currentHandle = this.handle;

That means that, when this.handleSize() is called without any parameters in line 173, the function tries to use this.currentHandle but, since it is not set, an error occurs.

To solve the problem I suggest changing line 173 to:

var value = ((parseInt($(handle != undefined ? this.handle[handle]
handle : this.currentHandle).css([0]),10) /

(this.size() - this.handleSize(handle != undefined ? handle : null))) * this.options.realMaxValue) + this.options.minValue;

Or, in summary, we need to call the this.handleSize() function with the handle index parameter if it has been provided: this.handleSize(handle != undefined ? handle : null).

There might be other instances were the this.handleSize() function is called that might need a similar revision, but I haven't found any myself.

#2617 fixed ui.slider.js range focus bug. eduardo norbert

If you go to the third example jQuery UI slider demo page (, move the first handle a couple of notches to the right and then click to the left or right of that first handle (i.e. to move it again), a JavaScript error occurs.

Changing the following line of the ui.slider.js focus function apparently solves the problem:

From: if(hard) this.currentHandle.parent()[0].focus();

To: if(hard && this.currentHandle.parent()[0]) this.currentHandle.parent()[0].focus();

Clicking on the slider range or the slider background without clicking first on one of the handles triggers other JavaScript errors too.

I have the feeling that the slider functionality mostly been tested using single-handle slider scenarios (which is probably what the slider will be used for 90% of the time). As a result, some functionality breaks when two handles and a range are present.



Note: See TracQuery for help on using queries.