Skip to main content

Search and Top Navigation

#4990 open bug ()

Opened December 03, 2009 11:38AM UTC

Last modified November 06, 2012 02:03AM UTC

sortable: Small placeholders compute overlap wrong

Reported by: dwt Owned by:
Priority: major Milestone: 2.0.0
Component: ui.sortable Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

When using sortables with much smaller drop-targets the computation of the overlay at which to switch the drop placeholder below the drop target is wrong.

It is not computed with the new location of the drop target, but instead with the old location of the drop target.

To clarify

+-------------

| first item in draggable list (item I want to drag)

| quite big

|

|

|

|

|

+-------------

+-------------

| second item (item I want to drag the first below) (quite small)

+-------------

The dropable placeholder is styled with css to be 10px tall, so it is much smaller than both the items, which themselves have different sizes. (other options are at their defaults, so overlap should be 50% to make the drop target jump below the original)

Now when I start dragging the first item, the second item moves up a great deal (due to the placeholder being very small) but to make the placeholder move below the dropped target you have to move the first item to a position where it would overlap the second item more than 50% at its location before the drag was started.

After this is done once, the overlap calculation works correctly - but is still repeatable when doing a fresh drag.

Attachments (0)
Change History (4)

Changed December 03, 2009 11:40AM UTC by dwt comment:1

ok, the ascii image got eaten, here it is again:

+------------- 
| first item in draggable list (item I want to drag) 
| quite big 
| 
| 
| 
| 
| 
+------------- 
+------------- 
| second item (item I want to drag the first below) (quite small) 
+-------------

Changed March 08, 2011 01:45PM UTC by SpadXIII comment:2

_comment0: This bug is still present in the latest jquery ui 1.8.10 (downloaded today) \ \ Easy check using the placeholder-demo: remove all items except 2 and alter the styling of first item to height:800px;. When dragging the big item, it doesn't change positions until it's dragged 400px down. After this, the dragging around works fine.1299592705537979

This bug is still present in the latest jquery ui 1.8.10 (downloaded today)

Easy check using the placeholder-demo: remove all items except 2 and alter the styling of first item to height:800px;. When dragging the big item, it doesn't change positions until it's dragged 400px down. After this, the dragging around works fine.

edit: a work-around is to call refreshPositions in the start-event.

Changed October 11, 2012 09:07PM UTC by scottgonzalez comment:3

milestone: TBD2.0.0

Changed November 06, 2012 02:03AM UTC by mikesherov comment:4

status: newopen
summary: sortable with small placeholders computes overlap wrongsortable: Small placeholders compute overlap wrong

Confirmed on latest: http://jsfiddle.net/Cbg44/3/