Skip to main content

Search and Top Navigation

#3988 closed bug (fixed)

Opened January 29, 2009 11:07PM UTC

Closed February 10, 2009 03:06PM UTC

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).

Attachments (0)
Change History (5)

Changed January 31, 2009 12:41AM UTC by Marc Diethelm comment:1

confirmed in latest trunk (after 1.6rc6)

Changed January 31, 2009 02:07AM UTC by rdworth comment:2

milestone: TBD1.6
version: 1.6rc51.6rc6

Changed February 05, 2009 02:37AM UTC by scottgonzalez comment:3

owner: → scott.gonzalez
status: newaccepted

Changed February 05, 2009 03:28AM UTC by scottgonzalez comment:4

owner: scott.gonzalez
status: acceptedassigned

Changed February 10, 2009 03:06PM UTC by paul comment:5

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.