Opened 6 years ago

Last modified 5 years ago

#9099 open bug

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:

Change History (8)

comment:1 Changed 6 years ago by tj.vantoll

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.

comment:2 Changed 6 years ago by mandeep.jain

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.

comment:3 Changed 6 years ago by tj.vantoll

Resolution: duplicate
Status: closedreopened

comment:4 Changed 6 years ago by tj.vantoll

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.

comment:5 Changed 6 years ago by mandeep.jain

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.

comment:6 Changed 6 years ago by tj.vantoll

Status: reopenedopen

comment:7 Changed 5 years ago by crimmcjsui

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:

comment:8 Changed 5 years ago by Skaffen

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:

Note: See TracTickets for help on using tickets.