Commit b307f910 authored by edchin's avatar edchin Committed by Commit Bot

[ios] Fix incorrect drag and drop index

The last position index is items.count-1 not items.count.

Bug: 1115486
Change-Id: I6e9072d15dfbee0cc161d81c22441bb0c82bcb87
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2373297Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801280}
parent bbbef102
...@@ -455,7 +455,8 @@ NSIndexPath* CreateIndexPath(NSInteger index) { ...@@ -455,7 +455,8 @@ NSIndexPath* CreateIndexPath(NSInteger index) {
NSIndexPath* dropIndexPath = coordinator.destinationIndexPath; NSIndexPath* dropIndexPath = coordinator.destinationIndexPath;
if (!dropIndexPath) { if (!dropIndexPath) {
dropIndexPath = [NSIndexPath indexPathForItem:self.items.count inSection:0]; dropIndexPath = [NSIndexPath indexPathForItem:(self.items.count - 1)
inSection:0];
} }
NSUInteger destinationIndex = NSUInteger destinationIndex =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment