I had a similar problem today, and the only solution I found was to introduce a flag variable that is set during the update event and checked during the stop event.
In your example, you are using a receive event that will fire on a list that receives a new item from some other list, so you should set it inside the $(".connectedSortable").sortable() .
Here is my way to distinguish between sorting (inside one list, processed in stop) or for moving (between two lists processed upon receipt):
$(function() { position_updated = false; //helper flag for sortable below $(".sortable").sortable({ connectWith: ".sortable", update: function(event, ui) { position_updated = !ui.sender; //if no sender, set sortWithin flag to true }, stop: function(event, ui) { if (position_updated) { processSortWithin(ui.item.attr("id"), ui.item.index()); position_updated = false; } }, receive: function(event, ui) { processSortBetween(ui.item.attr("id"), ui.item.index(),ui.sender.attr("id")); } }).disableSelection(); }); function processSortWithin(id, position) { alert("sort within"); } function processSortBetween(id, position, sender_id) { alert("sort between"); }
Working example: http://jsfiddle.net/myLff/2/
bkmn
source share