From f62f5369ecdb586e78bd7f2dc22435dfcee54074 Mon Sep 17 00:00:00 2001 From: Felix Emiliano Date: Tue, 23 Oct 2018 11:10:36 -0400 Subject: [PATCH] Ensures that the cell snapshot generated by MDCCollectionViewEditor reflects changes made to the cell (#5336) If explicitly setting this boolean to YES is a concern due to performance (there is no visible degradation of performance with this change in place), at the very least a property in the MDCCollectionViewEditing protocol should allow clients using the MDCCollectionViewController to control whether or not the snapshot captures the latest state of the cell. Closes #5335 --- components/Collections/src/private/MDCCollectionViewEditor.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Collections/src/private/MDCCollectionViewEditor.m b/components/Collections/src/private/MDCCollectionViewEditor.m index 1e53dff1c54..21b9dbcb193 100644 --- a/components/Collections/src/private/MDCCollectionViewEditor.m +++ b/components/Collections/src/private/MDCCollectionViewEditor.m @@ -221,7 +221,7 @@ - (UIView *)snapshotWithIndexPath:(NSIndexPath *)indexPath { [_collectionView.collectionViewLayout layoutAttributesForItemAtIndexPath:indexPath]; _cellSnapshot = [[ShadowedSnapshotView alloc] initWithFrame:attributes.frame]; UICollectionViewCell *cell = [_collectionView cellForItemAtIndexPath:indexPath]; - [_cellSnapshot addSubview:[cell snapshotViewAfterScreenUpdates:NO]]; + [_cellSnapshot addSubview:[cell snapshotViewAfterScreenUpdates:YES]]; // Invalidate layout here to force attributes to now be hidden. [_collectionView.collectionViewLayout invalidateLayout];