Reputation: 41
I just googled a lot but couldn't find an answer.
I have a resizable div and want to drop something onto it. It works very well so far. But when I use the clone-helper, the item just disappears when dropped. What am I doing wrong?
$('#resizable').droppable({
});
$('.base').draggable({
helper: 'clone',
stack: '#resizable',
containment: '#resizable',
cursor: 'move',
appendTo: '#resizable'
});
I played with appendTo, accept and everything. I just can't get it to work... Any idea is appreciated very much!
Upvotes: 4
Views: 3063
Reputation: 1524
I would try adding the following to your droppable's options:
$('#resizable').droppable({
drop: function(event, ui) {
$.ui.ddmanager.current.cancelHelperRemoval = true;
}
});
Upvotes: 10
Reputation: 2710
We were discussing similar issue in topic revert 'invalid' with grid doesn't return to start position with jQuery UI Draggable and @GregL offered workaround for this: http://jsfiddle.net/greglockwood/EBHWr/
I think this is exactly your situation. You need to define drop
handler in droppable
. This looks like a bug in jQuery with draggable
and helper: "clone"
.
Upvotes: 1