Skip to main content

Search and Top Navigation

#5602 closed bug (fixed)

Opened May 10, 2010 08:30PM UTC

Closed February 05, 2013 02:32PM UTC

Last modified February 05, 2013 02:35PM UTC

Slider Does Not Exhibit Proper Behavior When Switching Range

Reported by: jashugan Owned by:
Priority: minor Milestone: 1.10.1
Component: ui.slider Version: 1.8.1
Keywords: Cc:
Blocked by: Blocking:
Description

When switching the range of a slider from min to max (or vice versa), the slider stops working correctly. For example, take this bit of code.

#!js

$("#MasterSlider").slider({range: "min", min: 1, max: 10, step: 1});

// later on...
$("#MasterSlider").slider('option', 'range', 'max')

When the range is set to "min", the filled portion of the bar appears on the left. When set to "max", the filled portion of the bar appears on the right. However, when switching from "min" to "max" on an existing slider, the behavior becomes unexpected in two ways.

1. It doesn't update the filled region from left of the slider button to right of the slider button.

2. When moving the slider button the filled area doesn't work properly. (see attached image).

Attachments (1)
Change History (10)

Changed May 11, 2010 01:15AM UTC by watanabe comment:1

It seems "changing option 'range'" is not implemented properly.

See:

jQuery UI 1.8.1 uncompressed version.

jquery.ui.slider.js

line 80(slider _create)

this.range.addClass( "ui-slider-range-" + o.range );

line 516(slider _setOption)

	switch ( key ) {
+		case "range":
+			this.range.removeClass( "ui-slider-range-min ui-slider-range-max");
+			if ( value === "min" || value === "max" ) {
+				this.range.addClass( "ui-slider-range-" + value );
+			}
+			break;
		case "disabled":

seems to work when switching the range of a slider from min to max (or vice versa),

not to work when from (to) true (false).

"this.range" should be rebuilded.

Changed August 07, 2010 01:37AM UTC by scottgonzalez comment:2

milestone: TBD1.9

#4404 was closed as a duplicate.

Changed August 07, 2010 04:53AM UTC by antix70517 comment:3

Fix committed to http://github.com/lthibodeaux/jquery-ui/commit/12189f7

Somewhat sloppy on the commit message but I've been prodding for hours and it's late.

Changed August 07, 2010 05:19AM UTC by antix70517 comment:4

Reconciled some changes that were not mine with the code used to develop the fix. Final commit at:

http://github.com/lthibodeaux/jquery-ui/commit/898289a

Changed May 23, 2011 02:54PM UTC by scottgonzalez comment:5

#7412 is a duplicate of this ticket.

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

milestone: 1.9.01.11.0

Changed October 15, 2012 07:01PM UTC by tj.vantoll comment:7

status: newopen

This is still an issue in 1.9: http://jsfiddle.net/tj_vantoll/rF2cr/.

Changed January 30, 2013 07:15PM UTC by petersendidit comment:8

Changed February 05, 2013 02:32PM UTC by David Petersen comment:9

resolution: → fixed
status: openclosed

Slider: allow range option to be changed. Fixed #5602 - Slider Does Not Exhibit Proper Behavior When Switching Range

Changeset: df077abfc2a236a373d2080a9ceae97bb48c2620

Changed February 05, 2013 02:35PM UTC by scottgonzalez comment:10

milestone: 1.11.01.10.1