Opened 11 years ago
Last modified 8 years ago
#7853 open bug
Draggable: cloned helper of different dimensions than original not dragged by click point
Reported by: | duncanbeevers | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 2.0.0 |
Component: | ui.draggable | Version: | 1.8.16 |
Keywords: | haspatch | Cc: | |
Blocked by: | Blocking: |
Description
When a draggable is cloned and the helper has dimensions different than the original element, the drag registration point remains the click point on the original element instead of being scaled to the appropriate point on the cloned element.
Demonstration: http://jsfiddle.net/p8wXv/
Change History (7)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Proposed steps to implement:
- On start, calculate x and y position of mouse cursor relative to draggable: relX, relY
- Position helper top and left at position of mouse cursor (note: not at top/left of draggable)
- Use helper width / draggable width and helper height / draggable height to compute: factorX and factorY
- Translate helper left by relX * factorX and up by relY * factorY
This should ensure the cursor is over the helper and at an equal relative distance from the helper's top/left as the draggable's top/left
I believe https://github.com/duncanbeevers/jquery-ui/commit/bb4657e84c73f045dbe3f85620275987dc595fc8 may be missing step 2 above
comment:3 Changed 11 years ago by
I found I did not immediately have access to the cloned helper's dimensions.
comment:4 Changed 10 years ago by
Milestone: | 1.9.0 → 2.0.0 |
---|
comment:5 Changed 10 years ago by
Status: | new → open |
---|
comment:6 Changed 10 years ago by
Keywords: | haspatch added |
---|---|
Summary: | Draggable cloned helper of different dimensions than original not dragged by click point → Draggable: cloned helper of different dimensions than original not dragged by click point |
Submitted pull request for this bug.
Commit is here: https://github.com/duncanbeevers/jquery-ui/commit/bb4657e84c73f045dbe3f85620275987dc595fc8
Pull request is here: https://github.com/jquery/jquery-ui/pull/522