From c0e1fb23359b0552eb6cfad2c2aa46fba0ffb84a Mon Sep 17 00:00:00 2001 From: Bao Nguyen Date: Sun, 30 Aug 2026 19:11:33 +0700 Subject: [PATCH] fix(ios): reset extendUnderStatusBar on recycle `updateProps` diffs `extendUnderStatusBar` against the `_extendUnderStatusBar` ivar rather than `oldProps`, because Fabric keeps `_props` across recycling. `prepareForRecycle` resets that ivar but never pushes the reset down to the hosting view, and `resetSheetState` leaves the flag alone. A view recycled from a sheet that set `extendUnderStatusBar` therefore reads `false != NO`, skips the setter, and keeps the flag on, so `resolvedMaxDetentHeight` drops the status-bar overlap subtraction and a full-height detent runs under the status bar for a sheet that never asked for it. Reset the hosting view alongside the ivar so the two stay in sync, the way `restoreInlinePresentation` keeps `_nativeOverlay` in sync. --- ios/BottomSheetComponentView.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ios/BottomSheetComponentView.mm b/ios/BottomSheetComponentView.mm index b57d92a..7777563 100644 --- a/ios/BottomSheetComponentView.mm +++ b/ios/BottomSheetComponentView.mm @@ -429,6 +429,9 @@ - (void)prepareForRecycle [self restoreInlinePresentation]; _needsIndexSyncAfterRecycle = YES; [_sheetView resetSheetState]; + // `_extendUnderStatusBar` is the diff baseline for the prop, so the hosting + // view has to be reset with it or a recycled sheet keeps the previous flag. + [_sheetView setExtendUnderStatusBar:NO]; _sheetState.reset(); _lastContentOffsetY = 0; _lastGeometryFrameSize = CGSizeZero;