Ticket #3988 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 6 years ago by Marc Diethelm

confirmed in latest trunk (after 1.6rc6)

comment:2 Changed 6 years ago by rdworth

  • Version changed from 1.6rc5 to 1.6rc6
  • Milestone changed from TBD to 1.6

comment:3 Changed 6 years ago by scott.gonzalez

  • Owner set to scott.gonzalez
  • Status changed from new to accepted

comment:4 Changed 6 years ago by scott.gonzalez

  • Owner scott.gonzalez deleted
  • Status changed from accepted to assigned

comment:5 Changed 6 years ago by paul

  • Status changed from assigned to closed
  • Resolution set to fixed

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.