Skip to main content

Search and Top Navigation

#6876 closed bug (fixed)

Opened January 18, 2011 09:43PM UTC

Closed August 13, 2014 11:40PM UTC

Last modified August 14, 2014 12:04AM UTC

Droppable: droppable region is offset by draggables margin

Reported by: mlms13 Owned by: mikesherov
Priority: minor Milestone: 1.11.2
Component: ui.droppable Version: 1.8.7
Keywords: Cc:
Blocked by: Blocking:
Description

Div A is draggable and Div B is droppable. If you apply a margin to the draggable Div A, the region into which you can drop it is moved down and to the left by this margin. So if, for example, your droppable Div B is a gray box, if the margin on Div A is high enough, the actual droppable region completely misses the gray box. I would expect the droppable region to match up with Div B's boundaries, regardless of any margin applied to Div A.

For a live example, see: http://jsfiddle.net/crmGQ/2/

The top box (.empty) is supposed to be a droppable for the lower draggable (.color) box. Because of .color's 12 pixel margin, the droppable region is shifted far enough that you can almost cover the droppable in the top left corner with the draggable without actually triggering the drop event. This problem gets much worse if you increase .color's margin to something like 48px. The problem completely goes away if you set the margin to 0.

I hope this makes sense. Let me know if anything needs clarification or more examples. This is reproducible in Chrome 8, Firefox 3.6, and IE 9, using jQuery 1.4.4 and UI 1.8.7.

Attachments (0)
Change History (6)

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

milestone: 1.9.02.0.0

Changed October 26, 2012 05:41AM UTC by mikesherov comment:2

status: newopen

confirmed on latest: http://jsfiddle.net/gybTB/

Changed October 28, 2012 09:06PM UTC by mikesherov comment:3

summary: Droppable region is offset by draggable item's marginDraggable: Droppable region is offset by draggable item's margin

Changed August 13, 2014 11:04PM UTC by mikesherov comment:4

component: ui.draggableui.droppable
milestone: 2.0.01.11.1
owner: → mikesherov
status: openassigned
summary: Draggable: Droppable region is offset by draggable item's marginDroppable: droppable region is offset by draggables margin

Changed August 13, 2014 11:40PM UTC by Mike Sherov comment:5

resolution: → fixed
status: assignedclosed

Droppable: Account for draggable margins when detecting hover

Fixes #6876

Changeset: 4dad6bb99dae280108338c040d016f795d0da328

Changed August 14, 2014 12:04AM UTC by scottgonzalez comment:6

milestone: 1.11.11.11.2