LXReorderableCollectionViewFlowLayout
LXReorderableCollectionViewFlowLayout copied to clipboard
Duplicate cells appear while cell reordering.
While rearranging the cells, I have observed that duplicate cells appear. This issue gets corrected when I scroll. I have uploaded a video and sample code, to indicate the same, in a git repository (https://github.com/sourcebits-suraj/CellReorderIssue.git).
Can you suggest me any fix for this issue?
Did you find any solution to this problem?
Check PR #68. It may be related.
This could be a side effect of the collectionview, reusable cells, and how that all comes together when using this module. I ran into similar issues when using this code and was able to remedy it by reloading the data in the cells that had been effected in the drag operation.
I am also facing the same issue. When dragging the view to edges of the screen the collection view gets scrolled. Without dropping the dragging view, when I drag the view to the opposite sides edge of the screen collection view gets scrolled, but I am seeing the duplicate cells. I think the issue is due to the cell dequeue problem. If we have more number of items in collection view, then this problem is getting consistently.
I hope this issue will be fixed in next release. Before that I found the solution, then I will let you know.
Same here. @timfether would you like explain more about why the RP caused this issue?
It's been a while since I've looked at the code, but as I recall, there are some animations that create and remove views from the collection view. For instance, check LXReorderableCollectionViewFlowLayout.m around lines 350 and 394, where views are being removed from superview. My guess is that these calls are expected to happen, but something during the scrolling changes the state in a way that causes these not to be called.