Skip to content
Permalink
Browse files

[Chips] Reset cell selection state to NO on prepare for reuse. (#3444)

* reset cell selection state to NO on prepare for reuse to avoid unexpected behavior.

* updating comment.

#3444
  • Loading branch information
mohammadcazig committed Apr 23, 2018
1 parent 238b6d7 commit 847ebd5957369726fa226657a45fe408fc24485c
Showing with 8 additions and 0 deletions.
  1. +8 −0 components/Chips/src/MDCChipCollectionViewCell.m
@@ -41,6 +41,14 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder {
return self;
}

- (void)prepareForReuse {
[super prepareForReuse];

// When reload data we want to make sure we always reset the state. (Other wise animating layout
// could break the chip selection state).
self.selected = NO;
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
[super encodeWithCoder:aCoder];

0 comments on commit 847ebd5

Please sign in to comment.
You can’t perform that action at this time.