JQuery: Draggable on Resizable Droppable: element disappears after deletion

I just googled a lot, but could not find the answer.

I have a resizable div and want to pounce something on it. It still works very well. But when I use clone-helper, the element just disappears when deleted. What am I doing wrong?

$('#resizable').droppable({ }); $('.base').draggable({ helper: 'clone', stack: '#resizable', containment: '#resizable', cursor: 'move', appendTo: '#resizable' }); 

I played with appendTo, I accept everything. I just can't get it to work ... Any idea is much appreciated!

+4
source share
2 answers

I would try to add the following to your droppable options:

 $('#resizable').droppable({ drop: function(event, ui) { $.ui.ddmanager.current.cancelHelperRemoval = true; } }); 
+9
source

We discussed a similar problem in the revert 'invalid' topic when the grid did not return to its original position with jQuery UI Draggable and @GregL suggested a workaround for this: http://jsfiddle.net/greglockwood/EBHWr/

I think this is exactly your situation. You must define a drop handler in droppable . It looks like a jQuery bug with draggable and helper: "clone" .

+1
source

Source: https://habr.com/ru/post/1381328/


All Articles