Search code examples
angulardrag-and-dropangular8angular-cdkangulardraganddroplists

How to create droplist items dynamically with Angular8?


I found plenty of trivial examples how to use the different draggable directives but now I want to do this progmatically. There is a minimal sample app that demonstrates the problem. It receives the "dropped" event but the previousIndex and currentIndex are always the same.

https://stackblitz.com/edit/angular-8-drag-and-drop-dynamic-components

Click the add button a few times and then try to move them.


Solution

  • The issue is (was) a real bug: https://github.com/angular/components/issues/16961