Opened 7 years ago

Closed 7 years ago

#9411 closed bug (patcheswelcome)

Can't drag overlapping slider handles even if it's clicked directly

Reported by: Corke Owned by: Corke
Priority: minor Milestone: none
Component: ui.slider Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

Description

If the handles of the slider is modified to not fully overlap you still can't drag the second handle even if you click it directly.

STR:

  1. Load http://jsfiddle.net/TXudh/4/
  2. Hover the red handle and notice that is becomes green.
  3. Try to drag the red(now green) handle without moving the blue one.

Expected result: The red handle should be movable if it's clicked directly.

Actual result: Even if you click the red handle directly while on the same value as the blue the blue handle will be dragged.

Change History (3)

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

Owner: set to Corke
Status: newpending

Unfortunately this isn't simple to fix. Do you have a suggestion for how to make this work while also making #3467 work?

comment:2 Changed 7 years ago by Corke

Status: pendingnew

Ya the draggability, is a though one. We are trying to solve it by adding child elements to the handles and making the original handles very thin. Then through :nth-child(even) position them on the top and bottom of the slider to make them more draggable.

This idea breaks though, cause the slider that._lastChangedValue is used without checking if the handle was clicked directly. And as there is no clean way to override this, i filed this bug.

Though yes, the overlap problem is a hard one, and without changing design I don't really have a good suggestion on how to fix the draggabilioty of the handles. Cause subtracting the width of the handle from the slider would be even worse in my book (we have up to 4 handles and that would break it even worse then the current problem).

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

Resolution: patcheswelcome
Status: newclosed

We can't rely on which element was directly clicked, since that breaks a lot more use cases. I'll close as patches welcome in case anyone has any ideas, but I think what we currently have is the best we can do. I'd be happy to accept a pull request which pulls out the logic for which handle to make active so that you can override that yourself.

Note: See TracTickets for help on using tickets.