| Index: ios/chrome/browser/ui/payments/payment_request_selector_view_controller.mm
|
| diff --git a/ios/chrome/browser/ui/payments/payment_request_selector_view_controller.mm b/ios/chrome/browser/ui/payments/payment_request_selector_view_controller.mm
|
| index aee0278f710124c5aa00ecd6251db1d32cf52be8..339f5b5f84a193cd0f69325f62b1cae1148896f9 100644
|
| --- a/ios/chrome/browser/ui/payments/payment_request_selector_view_controller.mm
|
| +++ b/ios/chrome/browser/ui/payments/payment_request_selector_view_controller.mm
|
| @@ -261,23 +261,25 @@ typedef NS_ENUM(NSInteger, ItemType) {
|
|
|
| switch (item.type) {
|
| case ItemTypeSelectableItem: {
|
| - // Update the currently selected cell, if any.
|
| - if (self.dataSource.selectedItemIndex != NSUIntegerMax) {
|
| - DCHECK(self.dataSource.selectedItemIndex <
|
| - [[self.dataSource selectableItems] count]);
|
| - CollectionViewItem<PaymentsIsSelectable>* oldSelectedItem =
|
| - [[self.dataSource selectableItems]
|
| - objectAtIndex:self.dataSource.selectedItemIndex];
|
| - oldSelectedItem.accessoryType = MDCCollectionViewCellAccessoryNone;
|
| - [self reconfigureCellsForItems:@[ oldSelectedItem ]];
|
| - }
|
| -
|
| - // Update the newly selected cell.
|
| CollectionViewItem<PaymentsIsSelectable>* newSelectedItem =
|
| reinterpret_cast<CollectionViewItem<PaymentsIsSelectable>*>(item);
|
| - newSelectedItem.accessoryType = MDCCollectionViewCellAccessoryCheckmark;
|
| - [self reconfigureCellsForItems:@[ newSelectedItem ]];
|
| -
|
| + // Update the currently selected and the newly selected cells only if the
|
| + // newly selected cell corresponds to a complete item and can be selected.
|
| + if (newSelectedItem.isComplete) {
|
| + // Update the currently selected cell, if any.
|
| + if (self.dataSource.selectedItemIndex != NSUIntegerMax) {
|
| + DCHECK(self.dataSource.selectedItemIndex <
|
| + [[self.dataSource selectableItems] count]);
|
| + CollectionViewItem<PaymentsIsSelectable>* oldSelectedItem =
|
| + [[self.dataSource selectableItems]
|
| + objectAtIndex:self.dataSource.selectedItemIndex];
|
| + oldSelectedItem.accessoryType = MDCCollectionViewCellAccessoryNone;
|
| + [self reconfigureCellsForItems:@[ oldSelectedItem ]];
|
| + }
|
| + // Update the newly selected cell.
|
| + newSelectedItem.accessoryType = MDCCollectionViewCellAccessoryCheckmark;
|
| + [self reconfigureCellsForItems:@[ newSelectedItem ]];
|
| + }
|
| // Notify the delegate of the selection.
|
| NSUInteger index =
|
| [self.collectionViewModel indexInItemTypeForIndexPath:indexPath];
|
|
|