I'm currently developing a feature within an Angular application that involves a custom multi-select dropdown component. The goal is to allow users to select multiple items from this dropdown and then reorder these selected items via drag and drop.
However, I've encountered a couple of challenges that I've been unable to resolve:
Here's a link to a simplified version of my project on StackBlitz, which demonstrates the issues I'm facing: StackBlitz Example
Any advice or guidance on how to address these problems would be greatly appreciated. Thank you in advance for your time and help!
In your example on StackBlitz, you simply forgot to add the parameter cdkDropListOrientation="horizontal"
to the cdkDropList
div. (see example in documentation) Without this parameter, Angular interprets the position of the dragged object always as the first, since it expects a vertical container.