Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions src/components/bottomSheetModal/BottomSheetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const BottomSheetModalComponent = forwardRef<
snapPoints,
enablePanDownToClose = true,
animateOnMount = true,
containerComponent: ContainerComponent = React.Fragment,

// callbacks
onChange: _providedOnChange,
Expand Down Expand Up @@ -375,23 +376,25 @@ const BottomSheetModalComponent = forwardRef<
handleOnUpdate={handlePortalRender}
handleOnUnmount={handlePortalOnUnmount}
>
<BottomSheet
{...bottomSheetProps}
ref={bottomSheetRef}
key={key}
index={index}
snapPoints={snapPoints}
enablePanDownToClose={enablePanDownToClose}
animateOnMount={animateOnMount}
containerHeight={containerHeight}
containerOffset={containerOffset}
onChange={handleBottomSheetOnChange}
onClose={handleBottomSheetOnClose}
children={
typeof Content === 'function' ? <Content data={data} /> : Content
}
$modal={true}
/>
<ContainerComponent>
<BottomSheet
{...bottomSheetProps}
ref={bottomSheetRef}
key={key}
index={index}
snapPoints={snapPoints}
enablePanDownToClose={enablePanDownToClose}
animateOnMount={animateOnMount}
containerHeight={containerHeight}
containerOffset={containerOffset}
onChange={handleBottomSheetOnChange}
onClose={handleBottomSheetOnClose}
children={
typeof Content === 'function' ? <Content data={data} /> : Content
}
$modal={true}
/>
</ContainerComponent>
</Portal>
) : null;
});
Expand Down
8 changes: 8 additions & 0 deletions src/components/bottomSheetModal/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ export interface BottomSheetModalProps
*/
enableDismissOnClose?: boolean;

/**
* Add a custom container like FullWindowOverlay
* allow to fix issue like https://github.com/gorhom/react-native-bottom-sheet/issues/832
* @type React.ComponentType
* @default undefined
*/
containerComponent?: React.ComponentType<React.PropsWithChildren<{}>>;

// callbacks
/**
* Callback when the modal dismissed.
Expand Down