Skip to content

Commit 142405c

Browse files
fix: adjust header height and layout for ExpandingDrawer component
1 parent 169fd0e commit 142405c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/pluggableWidgets/bottom-sheet-native/src/components/ExpandingDrawer.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,10 @@ export const ExpandingDrawer = (props: ExpandingDrawerProps): ReactElement => {
178178
);
179179

180180
const hasMinimumMeasurements = !isSmallContentValid || smallContentHeight > 0;
181+
const headerHeight = isSmallContentValid ? smallContentHeight : 20; // Default header height if smallContent is not valid
181182

182183
return (
183-
<View style={StyleSheet.absoluteFillObject} pointerEvents="box-none">
184+
<View style={StyleSheet.absoluteFill} pointerEvents="box-none">
184185
{renderMeasurementTree()}
185186

186187
{hasMinimumMeasurements && snapPoints.length > 0 && (
@@ -196,13 +197,13 @@ export const ExpandingDrawer = (props: ExpandingDrawerProps): ReactElement => {
196197
enableDynamicSizing={false}
197198
>
198199
{/* Sticky header (smallContent) */}
199-
<BottomSheetView onLayout={onLayoutSmallContent} style={!isSmallContentValid ? { height: 20 } : {}}>
200+
<BottomSheetView onLayout={onLayoutSmallContent} style={{ height: headerHeight }}>
200201
{props.smallContent}
201202
</BottomSheetView>
202203

203204
{/* Scrollable content area */}
204205
<BottomSheetScrollView
205-
style={{ flex: 1 }} // Allow it to take available space
206+
style={{ flex: 1, marginTop: headerHeight }} // Allow it to take available space
206207
contentContainerStyle={{ paddingBottom: 16 }}
207208
>
208209
{/* Render largeContent and measure it if needed */}

0 commit comments

Comments
 (0)