Skip to content

Commit 14a603f

Browse files
afweissmaterial-automation
authored andcommitted
Fix Bottom sheet bug that was causing flickering.
PiperOrigin-RevId: 368045962
1 parent 381db18 commit 14a603f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

components/BottomSheet/src/private/MDCSheetContainerView.m

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
166166
return;
167167
}
168168

169-
[self updateSheetFrameRemoveAnimations:YES];
169+
[self updateSheetFrame];
170170
}
171171

172172
- (void)safeAreaInsetsDidChange {
@@ -186,7 +186,7 @@ - (void)safeAreaInsetsDidChange {
186186

187187
// Note this is needed to make sure the full displayed frame updates to reflect the new safe
188188
// area insets after rotation. See b/183357841 for context.
189-
[self updateSheetFrameRemoveAnimations:NO];
189+
[self updateSheetFrame];
190190
}
191191
}
192192

@@ -238,7 +238,7 @@ - (void)updateSheetHeight {
238238
}
239239
_preferredSheetHeight = adjustedPreferredSheetHeight;
240240

241-
[self updateSheetFrameRemoveAnimations:YES];
241+
[self updateSheetFrame];
242242
}
243243

244244
- (void)setPreferredSheetHeight:(CGFloat)preferredSheetHeight {
@@ -252,10 +252,8 @@ - (void)setAdjustHeightForSafeAreaInsets:(BOOL)adjustHeightForSafeAreaInsets {
252252
}
253253

254254
// Slides the sheet position downwards, so the right amount peeks above the bottom of the superview.
255-
- (void)updateSheetFrameRemoveAnimations:(BOOL)removeAnimations {
256-
if (removeAnimations) {
257-
[self.animator removeAllBehaviors];
258-
}
255+
- (void)updateSheetFrame {
256+
[self.animator removeAllBehaviors];
259257

260258
CGRect sheetRect = self.bounds;
261259
sheetRect.origin.y = CGRectGetMaxY(self.bounds) - [self effectiveSheetHeight];

0 commit comments

Comments
 (0)