Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#6193 closed bug (duplicate)

Only left handle can be dragged, if they have the same value

Reported by: marc_k Owned by:
Priority: major Milestone:
Component: ui.slider Version: 1.8.5
Keywords: Cc:
Blocked by: Blocking:

Description

On a range slider only the position of the left handle can be changed, if both handles are on the same position.

It's better if you change the code at line 284ff

if( o.range === true && this.values(1) === o.min ) {
  index += 1;
  closestHandle = $( this.handles[index] );
}

to this:

if (o.range === true && this.values(0) === this.values(1) && this.values(1) != o.max) {
  if (this.values(1) === o.min || this._valueFromMouse(position) > this.values(1)) {
    index = 1;
    closestHandle = $(this.handles[index]);
  }
}

and change the _normValueFromMouse function to this:

_normValueFromMouse: function( position ) {
  return this._trimAlignValue( this._valueFromMouse(position) );
},

_valueFromMouse: function( position ) {
  var pixelTotal,
    pixelMouse,
    percentMouse,
    valueTotal,
    valueMouse;

  ''(... code from original _normValueFromMouse function ...)''

  valueTotal = this._valueMax() - this._valueMin();
  valueMouse = this._valueMin() + percentMouse * valueTotal;

  return valueMouse;
},

Change History (3)

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

See also #3736.

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

Resolution: duplicate
Status: newclosed

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

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.