LXReorderableCollectionViewFlowLayout icon indicating copy to clipboard operation
LXReorderableCollectionViewFlowLayout copied to clipboard

Duplicate cells appear while cell reordering.

Open sourcebits-suraj opened this issue 11 years ago • 6 comments

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?

sourcebits-suraj avatar Mar 11 '14 06:03 sourcebits-suraj

Did you find any solution to this problem?

thomassnielsen avatar Sep 11 '14 15:09 thomassnielsen

Check PR #68. It may be related.

timfether avatar Sep 12 '14 00:09 timfether

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.

adam-davis avatar Jan 29 '15 06:01 adam-davis

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.

Yogesh-MV avatar Apr 29 '15 06:04 Yogesh-MV

Same here. @timfether would you like explain more about why the RP caused this issue?

luohui8891 avatar Jun 13 '15 06:06 luohui8891

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.

timfether avatar Jun 14 '15 14:06 timfether