Skip to main content

Search and Top Navigation

#9099 open bug ()

Opened February 19, 2013 07:03AM UTC

Last modified August 05, 2013 08:53AM UTC

Sortable: Items in connected list revert to last list interacted with rather than their starting point

Reported by: mandeep.jain Owned by:
Priority: minor Milestone: none
Component: ui.sortable Version: 1.8.13
Keywords: Cc:
Blocked by: Blocking:

Using the connected-lists option, when I drag an element from one list, and keep dragging over the other connected list, and release the mouse outside the other connected list, the element reverts back to the other list instead of the list where the element originally belongs.

Note that the element was just dragged over the second list, the second list also showed a default place holder where the element can be dropped, but the element was dropped outside the list and it reverted back to the second list where the placeholder was showing up instead of the first list where the element was dragged from.

Instead, if you drag the element anywhere in the page but do not go "over" the second list, the element reverts back to the original list.

Here is the issue reproduced in the fiddle:

Attachments (0)
Change History (8)

Changed February 19, 2013 11:41AM UTC by tj.vantoll comment:1

resolution: → duplicate
status: newclosed

Duplicate of #8792.Hi mandeep.jain,

Thanks for taking the time to contribute to the jQuery UI project. This is a duplicate of #8792 which has a pending pull request. Hopefully we can have a fix for you soon.

Changed February 19, 2013 01:45PM UTC by mandeep.jain comment:2

I have seen the ticket and other possible duplicates, which are because of using float, and just wanted to let you know that removing float doesnt resolve my issue.

My point is, if I drag and just hover an item from one list to another, the other item shows up a placeholder. But when I keep dragging the item from the other list too, it still shows the placeholder, whereas my item is now no longer hovering on it. Maybe thats why when I release the mouse, it reverts back to the second list, in which my item was never dropped(it was just hovered on it).

Instead what should be happening is that, if I dont drop the item in any of the connected list, It should revert back to the list where it originally belonged, irrespective of any other list which is currently showing a placeholder just because I hovered on it.

I hope you understood my point.

Changed February 20, 2013 02:47AM UTC by tj.vantoll comment:3

resolution: duplicate
status: closedreopened

Changed February 20, 2013 02:54AM UTC by tj.vantoll comment:4

summary: JQuery Sortable Connected Lists IssueSortable: Items in connected list revert to last list interacted with rather than their starting point

Ok, I see what you're saying now, this isn't a duplicate of #8792.

Although I believe this is intended behavior of the sortable interaction. I'll get the opinions of some others.

Changed February 21, 2013 06:24AM UTC by mandeep.jain comment:5

This behavior is wrong in terms of usability. Why should the item revert back to a list which it wasn't a part of.

What would be more appropriate is that if the item is being dragged and not 'over' on any other connected list, instead of showing a placeholder on the last interacted list, it should show the placeholder from the list/position where it was originally dragged.

Changed February 22, 2013 02:57AM UTC by tj.vantoll comment:6

status: reopenedopen

Changed June 29, 2013 12:36PM UTC by crimmcjsui comment:7

Fixed the issue for future releases by making sure that the item returns to the original position when dropped outside any sorted list. Previously it was dropped to the last possible position.

I've sent also a pull request base on the commit from my cloned repository:

Changed August 05, 2013 08:53AM UTC by Skaffen comment:8

This also causes unintuitive behaviour if also using droppables as well as connected lists. If you have two connected sortables and a droppable on the page (where the droppable is also a valid target) and drag an item from a sortable to the droppable but pass over the other sortable and then drop on the droppable then you get a drop event on the droppable and a receive event on the sortable which was passed over (caused by the same problem of the second sortable "receiving" the dragged item even if the item is dragged back out of the second sortable).

To see what I mean turn on the console on this and drag an item from the first list across the second list to the droppable area and you'll see "drop" logged then "sortreceive" logged: