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

[ios] Fix multiple selected items on tab grid insert

When new items are inserted and selected, the previous selection
should be removed.

Change-Id: Ide541c7636f9788ee77a62561a449d77815be3dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2267740
Commit-Queue: edchin <edchin@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782637}
parent daf36e16
......@@ -532,7 +532,12 @@ NSIndexPath* CreateIndexPath(NSInteger index) {
[self removeEmptyStateAnimated:YES];
[self.collectionView insertItemsAtIndexPaths:@[ CreateIndexPath(index) ]];
};
NSString* previouslySelectedItemID = self.selectedItemID;
auto completion = ^(BOOL finished) {
[self.collectionView
deselectItemAtIndexPath:CreateIndexPath([self
indexOfItemWithID:previouslySelectedItemID])
animated:YES];
[self.collectionView
selectItemAtIndexPath:CreateIndexPath(self.selectedIndex)
animated:YES
......
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