ngx-sortablejs icon indicating copy to clipboard operation
ngx-sortablejs copied to clipboard

Problem with sorting multiple of the same cloned element

Open Federen opened this issue 7 years ago • 2 comments
trafficstars

Hello,

I have a problem with sorting after cloning multiple of the same element - the view and the binded array does not match.

image

to reproduce the problem add the same element multiple times and sort the list after, after sorting a couple of times the array and ui does not match, you can use the following plunker :

https://plnkr.co/edit/ZSUQDErpoD1tQY5mvVd7?p=preview

Federen avatar Jan 04 '18 10:01 Federen

Hi @Federen

for me changing sort: false to revertClone: true and removing the clone from the target list (looks like) solved the problem

  normalOptions1: SortablejsOptions = {
    group:  {
      name : 'normal-group',
      pull: "clone",
      put: false,
      revertClone: true,
    },
  };
  
  normalOptions2: SortablejsOptions = {
   group:  {
      name : 'normal-group',
    }
  };

Please let me know if this fixed the issue

smnbbrv avatar Jan 09 '18 10:01 smnbbrv

for me the problem still exist, i pull in element 1 from normallist1 5 times to the top and reorder normallist2 and this occurs (the element object should be second to last)

capture

Federen avatar Jan 17 '18 11:01 Federen