Opened 10 years ago

Closed 9 years ago

#5057 closed bug (fixed)

multiple range sliders on a single page don't behave independently

Reported by: squaley Owned by:
Priority: major Milestone: 1.8
Component: ui.slider Version: 1.7.2
Keywords: slider multiple handles range Cc:
Blocked by: Blocking:

Description

From http://bit.ly/6S8nc1 :

When manipulating multiple range sliders (two handles per) on a single page, the position of the handle with the most recent focus is adopted by the next slider used.

Example: I've put multiple sliders on a single page. They are range sliders, with the following options set:

min: 0
max: 4
range: true
values: [0,4]

On the first slider, I move the min handle up 2 positions. This correctly sets this.options.values to [2,4].

Then, on any other slider, I mousedown on the max handle. It seems to think its own this.options.values is set to [2,4], same as the first slider, even though they are instantiated separately. Once the max handle is dragged to a new position, the min handle magically snaps to position 2.

Change History (3)

comment:1 Changed 10 years ago by Scott González

Milestone: TBD1.8

comment:2 Changed 10 years ago by squaley

Am noticing the sliders work as advertised if 1) they are instantiated one at a time; and 2) the options are spelled out explicitly in the first arg of slider(). So:

FAILS (not instantiated separately):
$('#slider0, #slider1, #slider2').slider({max: 7, range: true, values: [2,4]});

FAILS (not instantiated separately):
var slider_defaults = {max: 7, range: true, values: [2,4]};
$('#slider0, #slider1, #slider2').slider(slider_defaults);

FAILS (options not explicit in first arg):
var slider_defaults = {max: 7, range: true, values: [2,4]};
$('#slider0').slider(slider_defaults);
$('#slider1').slider(slider_defaults);
$('#slider2').slider(slider_defaults);

WORKS:
$('#slider0').slider({max: 7, range: true, values: [2,4]});
$('#slider1').slider({max: 7, range: true, values: [2,4]});
$('#slider2').slider({max: 7, range: true, values: [2,4]});

comment:3 Changed 9 years ago by Scott González

Milestone: 1.91.8
Resolution: fixed
Status: newclosed

This was fixed in 1.8 with the widget factory update.

Note: See TracTickets for help on using tickets.