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
307 stars 120 forks source link

Ref #17 - Add dndIndex to store the initial drag index of the dragged item #18

Open mtraynham opened 6 years ago

mtraynham commented 6 years ago

Related to #17

This stores the initial drag index in the dndState and provides it on an extended DragEvent during any of the link/move/copy/end emitters so a user can properly remove an item, such as in cases like primitives where an indexOf would otherwise be insufficient.

mtraynham commented 6 years ago

I noticed an issue and it seems this isn't entirely correct. Once drop happens the array may have shifted all the elements and thus the original drag index would be incorrect. Need to rethink this a bit.