Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

## [Unreleased]

- Add `bottomSheetWrapper` prop for `BottomSheetModal` component (#832)(by @magrinj)

### [v4.4.7](https://github.com/gorhom/react-native-bottom-sheet/compare/v5.0.0-alpha.1...v4.4.7) -

#### Fixes
Expand Down
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,
bottomSheetWrapper: BottomSheetWrapper = 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}
/>
<BottomSheetWrapper>
<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}
/>
</BottomSheetWrapper>
</Portal>
) : null;
});
Expand Down
7 changes: 7 additions & 0 deletions src/components/bottomSheetModal/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ export interface BottomSheetModalProps
*/
enableDismissOnClose?: boolean;

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

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