Hi Manuel,
We've checked your sample. When you set the clone property to true, the drag element won't automatically copy to where you drop it. Instead, you'll need to manually make a copy of the dragged element and place it in target location. You can do this by returning the copied element from a function called helper.
Refer to the below code-snippet:
const dragHelper = (args: { sender: Event, element: HTMLElement }) => { let element: HTMLElement = args.element.cloneNode(true) as HTMLElement; document.getElementById('myContent')?.appendChild(element); return element; } new Draggable(document.getElementById("ElementToDrag_1") as HTMLElement, { clone: true, helper: dragHelper }); new Draggable(document.getElementById("ElementToDrag_2") as HTMLElement, { clone: true, helper: dragHelper }); new Draggable(document.getElementById("ElementToDrag_3") as HTMLElement, { clone: true, helper: dragHelper }); |
For your reference, we have attached the working sample below.
Regards,
Vijay
Attachment:
angulardraggable_ad38ecf2_5742f2b.zip