Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 847ebd5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/Chips/src/MDCChipCollectionViewCell.m
Expand Up @@ -41,6 +41,14 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder {
return self; 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 { - (void)encodeWithCoder:(NSCoder *)aCoder {
[super encodeWithCoder:aCoder]; [super encodeWithCoder:aCoder];


Expand Down

0 comments on commit 847ebd5

Please sign in to comment.