1

Dear all Angular gurus...

I had found an awesome angular material multi drag drop example online and wanted to limit the drag drop only allow from ListA to ListB, and disable the drag drop from ListB to ListA. (stackblitz link attached below)

Had been trying for hours but still couldn't figure this out... can any Angular expertise assist me on this one... is there a particular event in CdkDragDrop that I need to implement in order for it to work?

https://stackblitz.com/edit/angular-multi-drag-drop-3part-vxkzje?file=src/app/multi-drag-drop.component.ts

  • The simplest would be setting some type of the dragged element in `dragstart` eventhandler and checking this type in the `dragover` and `drop` eventhandler. If the type does not match in `dragover` set the respective `dropEffect`. If the type does not match in `drop` just don't do anything with the dropped element ... – derpirscher Jan 10 '21 at 19:44
  • @derpirscher thanks for pointing the right direction... I tried, but the `dragMove` & `dragRelease` received in eventhandler doesn't allow me to access to the target container that im dropping to. I only have access to the original container that im dragging from... – user2374267 Jan 11 '21 at 06:02
  • @derpirscher I have tried with `cdkDropListEnterPredicate` ... but that part of the code never run... so weird. you can check my stackblitz > – user2374267 Jan 11 '21 at 17:11

0 Answers0