Opened 12 years ago

Closed 9 years ago

Last modified 9 years ago

#6876 closed bug (fixed)

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.

Change History (6)

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

Milestone: 1.9.02.0.0

comment:2 Changed 10 years ago by mikesherov

Status: newopen

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

comment:3 Changed 10 years ago by mikesherov

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

comment:4 Changed 9 years ago by mikesherov

Component: ui.draggableui.droppable
Milestone: 2.0.01.11.1
Owner: set to mikesherov
Status: openassigned
Summary: Draggable: Droppable region is offset by draggable item's marginDroppable: droppable region is offset by draggables margin

comment:5 Changed 9 years ago by Mike Sherov

Resolution: fixed
Status: assignedclosed

Droppable: Account for draggable margins when detecting hover

Fixes #6876

Changeset: 4dad6bb99dae280108338c040d016f795d0da328

comment:6 Changed 9 years ago by Scott González

Milestone: 1.11.11.11.2
Note: See TracTickets for help on using tickets.