diff options
-rw-r--r-- | modules/bottom-sheet/ios/SheetView.swift | 3 | ||||
-rw-r--r-- | modules/bottom-sheet/src/BottomSheetNativeComponent.tsx | 13 | ||||
-rw-r--r-- | modules/bottom-sheet/src/BottomSheetNativeComponent.web.tsx | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/modules/bottom-sheet/ios/SheetView.swift b/modules/bottom-sheet/ios/SheetView.swift index 2223a5a8c..b6df8d7d2 100644 --- a/modules/bottom-sheet/ios/SheetView.swift +++ b/modules/bottom-sheet/ios/SheetView.swift @@ -144,7 +144,8 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate { } func updateLayout() { - if self.prevLayoutDetentIdentifier == self.selectedDetentIdentifier, + // Allow updates either when identifiers match OR when prevLayoutDetentIdentifier is nil (first real content update) + if (self.prevLayoutDetentIdentifier == self.selectedDetentIdentifier || self.prevLayoutDetentIdentifier == nil), let contentHeight = self.innerView?.subviews.first?.frame.size.height { self.sheetVc?.updateDetents(contentHeight: self.clampHeight(contentHeight), preventExpansion: self.preventExpansion) diff --git a/modules/bottom-sheet/src/BottomSheetNativeComponent.tsx b/modules/bottom-sheet/src/BottomSheetNativeComponent.tsx index 1fe592aa2..869b89e3d 100644 --- a/modules/bottom-sheet/src/BottomSheetNativeComponent.tsx +++ b/modules/bottom-sheet/src/BottomSheetNativeComponent.tsx @@ -1,18 +1,21 @@ import * as React from 'react' import { Dimensions, - LayoutChangeEvent, - NativeSyntheticEvent, + type LayoutChangeEvent, + type NativeSyntheticEvent, Platform, - StyleProp, + type StyleProp, View, - ViewStyle, + type ViewStyle, } from 'react-native' import {useSafeAreaInsets} from 'react-native-safe-area-context' import {requireNativeModule, requireNativeViewManager} from 'expo-modules-core' import {isIOS} from '#/platform/detection' -import {BottomSheetState, BottomSheetViewProps} from './BottomSheet.types' +import { + type BottomSheetState, + type BottomSheetViewProps, +} from './BottomSheet.types' import {BottomSheetPortalProvider} from './BottomSheetPortal' import {Context as PortalContext} from './BottomSheetPortal' diff --git a/modules/bottom-sheet/src/BottomSheetNativeComponent.web.tsx b/modules/bottom-sheet/src/BottomSheetNativeComponent.web.tsx index f1a77cf33..8149561a3 100644 --- a/modules/bottom-sheet/src/BottomSheetNativeComponent.web.tsx +++ b/modules/bottom-sheet/src/BottomSheetNativeComponent.web.tsx @@ -1,4 +1,4 @@ -import {BottomSheetViewProps} from './BottomSheet.types' +import {type BottomSheetViewProps} from './BottomSheet.types' export function BottomSheetNativeComponent(_: BottomSheetViewProps) { throw new Error('BottomSheetNativeComponent is not available on web') |