angular-legacy-sortablejs icon indicating copy to clipboard operation
angular-legacy-sortablejs copied to clipboard

Nested ng-sortable is not working

Open samuelcastro opened this issue 9 years ago • 7 comments
trafficstars

I'm trying to use ng-sortable inside a directive that is using ng-sortable like:

directive1:

ng-sortable 
    ng-repeat(list1)
      directive2

directive2

   ng-sortable
      ng-repeat(list2)

directive1 is working fine, the list is ordered as expected, but on directive2 when trying to order (dragging/dropping) its changing the order going back to the original position. If I remove the ng-sortable config on directive1 the directive2 start working.

Any idea?

samuelcastro avatar Aug 10 '16 20:08 samuelcastro

I have approximatively same problem when use ng-sortable inside a directive who alreay use ng-sortable.

I haven't problem with directive 2 (drag/drop work well inside directive 2), but I have problem when I try to put item of list2 in list1

I have make plunker in issue #8 and #9

I try to fix this problem with no success

Akta3d avatar Aug 11 '16 09:08 Akta3d

I've got nested sorting to work I was using nested components, try making your directives have isolated scope, failing that you prob could pass a conf object to ng-sortable and declare a group see here for options and the readme for examples

samjacobclift avatar Sep 13 '16 11:09 samjacobclift

@royka either using isolated scope or group it's not working. :(

The only detail that I'm not sure could make or not any difference here is that I'm requiring ngModel in my directive: require: 'ngModel'

samuelcastro avatar Nov 16 '16 00:11 samuelcastro

ngModel shouldn't make a difference I think, perhaps try wrapping the ngmodel directive in some html

samjacobclift avatar Nov 16 '16 10:11 samjacobclift

+1... Running into this issue as well. Any solutions yet? The child sortable is taking the parent sortable's index value which is breaking functionality.

adidas-jordan avatar Dec 08 '16 21:12 adidas-jordan

@samjacobclift Still getting this issue, any idea?

samuelcastro avatar Apr 20 '17 22:04 samuelcastro

I think this might be to do with the version of sortable JS being used, what versions are you guys using?

samjacobclift avatar Dec 14 '17 21:12 samjacobclift