I am trying to drag and drop one way with copy with ng2 dragula This is my template.
`<div>
<div class='wrapper'>
<div class='container' id='no-drop' [dragula]='"first-bag"'>
<div>Drag/drop item 1</div>
</div>
<div class='container' [dragula]='"first-bag"'>
<div>Drag/drop item 2</div>
</div>
</div>
</div>`
I have set the option to copy in my component.
constructor(private dragulaService: DragulaService) {
dragulaService.setOptions('first-bag', {
copy: true
});
But if i set moves to false, i am not able to drag at all. How can i move from left to right and not the other way.
I found the answer soon after posting!!
constructor(private dragulaService: DragulaService) {
dragulaService.setOptions('first-bag', {
copy: true,
moves: function (el, container, handle) {
return container.id !== 'no-drop';
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With