-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cells ordering gets messed up when dragging one cell quickly. #11
Comments
Also seeing this problem. hpique or aksh1t did you have any leads code-wise where things are going wrong? |
It looks to be the ordering of the call to diff --git a/HPReorderTableView/HPReorderTableView.m b/HPReorderTableView/HPReorderTableView.m
index b7d3fc7..5709fb4 100644
--- a/HPReorderTableView/HPReorderTableView.m
+++ b/HPReorderTableView/HPReorderTableView.m
@@ -296,7 +296,7 @@ static void HPGestureRecognizerCancel(UIGestureRecognizer *gestureRecognizer)
- (void)reorderCurrentRowToIndexPath:(NSIndexPath*)toIndexPath
{
[self beginUpdates];
- [self moveRowAtIndexPath:toIndexPath toIndexPath:_reorderCurrentIndexPath]; // Order is important to keep the empty cell behind
+ [self moveRowAtIndexPath:_reorderCurrentIndexPath toIndexPath:toIndexPath];
if ([self.dataSource respondsToSelector:@selector(tableView:moveRowAtIndexPath:toIndexPath:)])
{
[self.dataSource tableView:self moveRowAtIndexPath:_reorderCurrentIndexPath toIndexPath:toIndexPath]; Not submitting a pull request for this as the order appears to be deliberately set that way (59f025c) to work around another issue, which I can't test for. -bok |
So my patch above does re-introduce the behaviour I think 59f025c was supposed to fix; that is, the cell being moved moves on top of the other cells. I fixed that by setting the cell layer's zPosition on dequeue so that won't happen and now both bugs appear to be fixed: cell.layer.zPosition = -10; I'll pop in a pull request shortly. |
Quick drag also causes call of |
Hi hpique, thanks a lot for this wonderful tableview. While playing around with the demo app, I found a pretty serious bug... I have made gif demonstrating the same.
When I long press on a cell and then move it around very quickly (in both directions - up and down), the ordering of the other cells gets messed up.
For example, in the gif above, look at the cell 4. It gets stuck to the cell that I am currently dragging around. And when I leave the cell 1, a blank space is found where actually the cell 4 should have been.
Also, when dragging the cell over long distance (in both directions, quickly), the ordering of other cells in the table view gets haphazard. If this bug is difficult to reproduce, please do ask to clarify, I'll be happy to make other gifs with more detailed description to sort this bug out.
Thanks again, hpique!
The text was updated successfully, but these errors were encountered: