jQuery UI Sliders - Select overlapping sliders based on dragging direction

前端 未结 7 1532
猫巷女王i
猫巷女王i 2021-01-02 11:27

I have this simple jQuery UI Slider setup with a range and a two default values that overlap. The entire thing (with a few bells and whistles) can be found in this jsfiddle:

7条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-02 12:25

    I'd say this is a bug, doubly so because there's already logic preventing a ‘deadlock’ from happening when both slider handles are at the minimum / far left position:

    // workaround for bug #3736 (if both handles of a range are at 0,
    // the first is always used as the one with least distance,
    // and moving it is obviously prevented by preventing negative ranges)
    if( o.range === true && this.values(1) === o.min ) {
      index += 1;
      closestHandle = $( this.handles[index] );
    }
    

    It looks like ticket #3736 is still open, with mentioning of the specific problem you're seeing.

提交回复
热议问题