reppners / ngx-drag-drop

Angular directives using the native HTML Drag And Drop API
https://reppners.github.io/ngx-drag-drop/
BSD 3-Clause "New" or "Revised" License
299 stars 117 forks source link

When having a 2D grid system dragged item is not erased, creating a temporary tile #157

Open vmuresanu opened 8 months ago

vmuresanu commented 8 months ago

Describe the bug When having a 2D grid system dragged item is not erased, thus placeholder generates a new tile.

Steps to reproduce the behavior:

  1. Have a 2D grid system with any number of divs of a specific height and width and a placeholder available.
  2. Drag any div
  3. Observe that the div is draggable but the original tile does not get removed, thus temporarily adding a new item and shuffling the rest of them

Expected behavior The original tile is removed.

Screenshots ngx-drag-drop issue

https://stackblitz.com/edit/stackblitz-starters-veznfz?description=An%20angular-cli%20project%20based%20on%20@angular/animations,%20@angular/common,%20@angular/compiler,%20@angular/core,%20@angular/forms,%20@angular/platform-browser,%20@angular/platform-browser-dynamic,%20@angular/router,%20core-js,%20rxjs,%20tslib%20and%20zone.js&file=src%2Fmain.ts,src%2Fapp.component.scss,src%2Fapp.component.html&title=Angular%20Starter

Desktop (please complete the following information):

Additional context Note: Tried to remove the item from the array at DragStart method, but the dragged item also gets removed.
Note2: Maybe this is not a bug, and there is a way to remove the dragged item while keeping the dragging image availablem but I couldn't figure the way