akserg / ng2-dnd

Angular 2 Drag-and-Drop without dependencies
MIT License
840 stars 252 forks source link

drag all elements in multi list Multi list sortable #96

Open eladr2805 opened 7 years ago

eladr2805 commented 7 years ago

Hi, Great module....works as expected...but if i drag all boxers to first team container i cant return them back. I can return items backas long as there are still items in the boxers but if i drag all of them i cant...

Thanks...

jmesa-sistel commented 7 years ago

Same here But works from Team 1 to Team 2 (or viceversa) but not to the boxers div.

eladr2805 commented 7 years ago

What do you mean from team 1 to team 2?

eladr2805 commented 7 years ago

Now got it....so what is the difference between them and how to solve it?

jmesa-sistel commented 7 years ago

Move all boxers to first team, now you can move all boxers from first team to second team. Now you cannot move to "available boxers" div but you can move to "first team" div.

PS: too slow ;)

jmesa-sistel commented 7 years ago

No idea how to solve it at now, we have to wait to @akserg, I have not time now to debug the issue myself sorry.

eladr2805 commented 7 years ago

Ok thanks anyway :)

jmesa-sistel commented 7 years ago

Found a quick fix, but I guess it is a wrong solution. change this.dropEnabled = this._sortableData.length === 0; by this.dropEnabled = true; in sortable.component.ts. If you don't want to recompile component do the change in node_modules/ng2-dnd/src/sortable.component.js

eladr2805 commented 7 years ago

Thanks...i will check it.

jmesa-sistel commented 7 years ago

I understand what the code do, but I donot understand why @akserg has added that restriction. If a 'sortable' div has data then you can not drop an item in the div. We will have to wait his answer

retwedt commented 7 years ago

+1 Having this same issue as well. Using Angular rc5 and ng2-dnd 1.13.1.

eshinx1 commented 7 years ago

first...Thank you for the amazing package!

+1 on this issue. I am assuming there are issues because the explicit need to make sure when moving containers dropEnabled must be true.

@akserg is this something that you will be working on in the near future?

I've also tried moving the inner sortable list into a separate component to no success.

Thanks!