kutlugsahin / ngx-smooth-dnd

angular wrapper for smooth-dnd
165 stars 30 forks source link

Unable to drag dynamically created components #17

Closed chris-erxnieves closed 6 years ago

chris-erxnieves commented 6 years ago

Hey, first I want to say thank you so much for creating this awesome project! We're just running into one issue. It seems like the tool is unable to handle dynamically created components. Thoughts on this?

Here's a Stackblitz of the issue

danielcarlstrom commented 6 years ago

Hi, I think the issue is that your dynamic component wraps the smooth-dnd-draggable in test.

Made some changes to your code, used smooth-dnd-draggable as selector for TestComponent. Then it's directly beneath smooth-dnd-container once created.

However you need the correct class on the children, so I added it in the selector like: smooth-dnd-draggable[class="smooth-dnd-draggable-wrapper"]

I hope it does what you want :) here

chris-erxnieves commented 6 years ago

Ah, okay. That solution works for us. Closing this issue. Thank you!