Search code examples
angular-materialdrag-and-drop

How to provide mixed orientation to Angular Material drag e drop v10


I am using Material drag e drop they don't allow the mixed-orientation of the drag e drop so to use it with both directions I use this workaround.

But in the last release, they removed CdkDropList.enter method.

So now how can I achieve the same result as before?


Solution

  • Here the solution: https://github.com/angular/components/issues/13372#issuecomment-664067103

    this is the new code from angular 9 version:

    this.source._dropListRef.start();
    this.placeholder._dropListRef.enter(drag._dragRef, drag.element.nativeElement.offsetLeft, drag.element.nativeElement.offsetTop);