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

onDrop to push new items to list to re-render ngComponentOutlet does not work #158

Closed guoliang closed 11 months ago

guoliang commented 11 months ago

Describe the bug

Drag and drop to a drop zone which is then using drag data to render dynamic components with ngComponentOutlet does not seems to work.

Not sure if it's issue with ngxDragDrop or if it's a general issue.

To Reproduce I have created a minimal demo where you can test see the issue live https://stackblitz.com/edit/stackblitz-starters-9blmkp?file=src%2Fmain.ts

Steps to reproduce the behavior:

  1. Drag element which has the name Drag to add boxes into canvas

Expected behavior A new box should be rendered in the location where the placeholder is, but nothing was added. However you can see that the count of boxes has increased.

Additional context

This issue is in Angular 16, using ngxDragDrop 16

guoliang commented 11 months ago

Found the issue. It is because the data transfered cannot be class object, or at least not a Angular component. Anyhow, there are workaround for it, luckily.