Add height constraint to full-height bottom sheets (#11178)

This commit is contained in:
DS Boyce
2026-07-20 10:01:31 -07:00
committed by GitHub
parent 92ef1528bf
commit 0f27fdda65
2 changed files with 4 additions and 2 deletions
@@ -146,6 +146,7 @@ function BottomSheetNativeComponentInner({
const insets = useSafeAreaInsets()
const cornerRadius = rest.cornerRadius ?? 0
const {height: screenHeight} = useWindowDimensions()
const isHeightConstrained = maxHeight != null || rest.fullHeight === true
// sigh... on older Android versions, screenHeight does not include safe area insets
// on newer Androids + iOS, it does. we need to find the inner bit + the bottom inset
@@ -182,7 +183,7 @@ function BottomSheetNativeComponentInner({
]}>
<View
onLayout={onLayout}
style={maxHeight == null ? undefined : {flex: 1}}>
style={isHeightConstrained ? {flex: 1} : undefined}>
<BottomSheetPortalProvider>{children}</BottomSheetPortalProvider>
</View>
</View>
+2 -1
View File
@@ -157,7 +157,8 @@ export function Outer({
[open, close],
)
const isHeightConstrained = nativeOptions?.maxHeight != null
const isHeightConstrained =
nativeOptions?.maxHeight != null || nativeOptions?.fullHeight === true
const context = useMemo(
() => ({