ng2-dnd icon indicating copy to clipboard operation
ng2-dnd copied to clipboard

Slow sorting of large arrays

Open rikte88 opened this issue 7 years ago • 3 comments

  • I'm submitting a ... [x] bug report [x] feature request [ ] question about the decisions made in the repository

  • Do you want to request a feature or report a bug? Unsure whether to mark as bug or feature request. Technically it works but is very slow. When sorting dnd-sortable-container, the array pointed by [sortableData]="..." is modified before the user releases the mouse.

  • What is the current behavior? With a large array this is very slow and queues up multiple rerendering cycles.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar.

  • What is the expected behavior? The array is modified when the user releases the mouse, if and only if the new position is different from the original position.

  • What is the motivation / use case for changing the behavior? The current implementation is unusable for large arrays.

  • Please tell us about your environment:

  • Angular version: 2.X.X
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

rikte88 avatar Oct 07 '17 20:10 rikte88

Same problem here. A fix as proposed in the expected behavior above would be great.

SteffenTallieu avatar Oct 07 '17 21:10 SteffenTallieu

Facing the same issue, I have nested structure with depth of 3 and all inner items are having dnd-droppable. The single dnd-sortable has affected performance of all the modules.

Thanks, Abhishek.

abhishekdgeek avatar Oct 27 '17 05:10 abhishekdgeek

Excellent fixes here #67

IdanCo avatar Jan 26 '18 16:01 IdanCo