Skip to main content

Search and Top Navigation

#7853 open bug ()

Opened November 09, 2011 07:46AM UTC

Last modified August 18, 2014 01:44AM UTC

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/

Attachments (0)
Change History (7)

Changed November 09, 2011 08:54AM UTC by duncanbeevers comment:1

Changed November 09, 2011 04:13PM UTC by rdworth comment:2

Proposed steps to implement:

1. On start, calculate x and y position of mouse cursor relative to draggable: relX, relY

2. Position helper top and left at position of mouse cursor (note: not at top/left of draggable)

3. Use helper width / draggable width and helper height / draggable height to compute: factorX and factorY

4. 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

Changed November 09, 2011 04:46PM UTC by duncanbeevers comment:3

I found I did not immediately have access to the cloned helper's dimensions.

Changed October 11, 2012 02:49PM UTC by scottgonzalez comment:4

milestone: 1.9.02.0.0

Changed October 28, 2012 04:43AM UTC by mikesherov comment:5

status: newopen

Changed November 09, 2012 01:46PM UTC by mikesherov comment:6

keywords: → haspatch
summary: Draggable cloned helper of different dimensions than original not dragged by click pointDraggable: cloned helper of different dimensions than original not dragged by click point

Changed August 18, 2014 01:44AM UTC by mikesherov comment:7

#9325 is a duplicate of this ticket.