Opened 14 years ago

Closed 14 years ago

#3988 closed bug (fixed)

Sortable "out" event is being fired on drop

Reported by: natecavanaugh Owned by:
Priority: blocker Milestone: 1.7
Component: ui.sortable Version: 1.6rc6
Keywords: Cc:
Blocked by: Blocking:

Description

This may not be a bug, but it's leading to buggy behavior that did not exist in 1.5

When you drop a sortable, the "out" event is fired. The issue I am running into is that the ui.helper property is set to null, and any attempt to modify the helper is causing the script to break.

To see this in action just do this in tests/visual/sortable/sortable.html

$("#sortable").sortable({

helper: function() {

var instance = this;

return jQuery('<div style="width: 50px; height: 50px; background: #000"></div>')[0];

}, out: function(event, ui) {

var instance = this;

console.log('fires when leaving the sortable, and when the sortable is dropped', ui, ui.helper);

},

});

It would be possible to check in the out callback, but I'm not sure this call back should logically be called (because the helper never actually left the sortable, hence, it's not really out, AND it's different from behavior in 1.5).

Change History (5)

comment:1 Changed 14 years ago by Marc Diethelm

confirmed in latest trunk (after 1.6rc6)

comment:2 Changed 14 years ago by rdworth

Milestone: TBD1.6
Version: 1.6rc51.6rc6

comment:3 Changed 14 years ago by Scott González

Owner: set to scott.gonzalez
Status: newaccepted

comment:4 Changed 14 years ago by Scott González

Owner: scott.gonzalez deleted
Status: acceptedassigned

comment:5 Changed 14 years ago by paul

Resolution: fixed
Status: assignedclosed

There were numerous problems with the triggering of the over/out logic, which are fixed in r2064. This should also adress your issue.

However, note that the "out" callback will still be triggered if you drag into a list and then release the mouse (but not if you're not over the list). This is logical behaviour and happens for normal sortables as well.

Note: See TracTickets for help on using tickets.