bevacqua / dragula

:ok_hand: Drag and drop so simple it hurts
https://bevacqua.github.io/dragula/
MIT License
21.89k stars 1.97k forks source link

Add option to disable reordering within container #519

Open popey456963 opened 6 years ago

ArnaudPel commented 6 years ago

As a workaround, this feature can be obtained by canceling the drop event, as described here or here.

I've done it with Angular and Typescript, but here's a adaptation that should hopefully point towards the right direction:

function onDrop(el, container, source) {  // bind that to dragula's drop events as per the docs
  if (container === source) {
    drake.cancel(true);
  }
}

I've just done it a few minutes ago, so I'm not aware of possible averse side-effects yet.