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
comment:2 Changed 14 years ago by
Milestone: | TBD → 1.6 |
---|---|
Version: | 1.6rc5 → 1.6rc6 |
comment:3 Changed 14 years ago by
Owner: | set to scott.gonzalez |
---|---|
Status: | new → accepted |
comment:4 Changed 14 years ago by
Owner: | scott.gonzalez deleted |
---|---|
Status: | accepted → assigned |
comment:5 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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.
confirmed in latest trunk (after 1.6rc6)