Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery: Draggable on Resizable Droppable: Item disappears after dropping

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!

like image 909
Florian Kratschmann Avatar asked Dec 22 '22 06:12

Florian Kratschmann


1 Answers

I would try adding the following to your droppable's options:

$('#resizable').droppable({
    drop: function(event, ui) {
        $.ui.ddmanager.current.cancelHelperRemoval = true;
    }
});
like image 60
Sisi Avatar answered Dec 23 '22 20:12

Sisi