two list drop problem element's positions wrong coordinates

Viewed 79

So here is the old version from angular 9 which functions properly.

https://stackblitz.com/edit/two-drop-list-problem-zp556d?file=package.json

new version angular 14:

https://stackblitz.com/edit/angular-ivy-1jvbnn?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.css,src%2Fapp%2Fapp.module.ts,src%2Fstyles.css,package.json

In the new version the dragged object jumps across the window when the mouse is released. I've tried removing sorting and disabling on drop, but I'm not quite sure what to do at this point.


original post here: Angular Drag and Drop absolute position elements selecting wrong index

enter image description here

1 Answers

It doesnt need to include "this.bigList[0].left = event.dropPoint.x" and
"this.bigList[0].top = event.dropPoint.y"

  dragEnded(event: CdkDragEnd) {
    console.log(`[ ::: dragEnded - X ]   ${event.dropPoint.x} ::: dragEnded - Y ]  ${event.dropPoint.y}   `)
   // this.bigList[0].left = event.dropPoint.x
   // this.bigList[0].top = event.dropPoint.y

  }

rebuild from there the coordinate map from there

Related