Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 8 additions & 3 deletions src/components/bottomSheetBackdrop/BottomSheetBackdrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const BottomSheetBackdropComponent = ({
enableTouchThrough = DEFAULT_ENABLE_TOUCH_THROUGH,
pressBehavior = DEFAULT_PRESS_BEHAVIOR,
style,
children,
}: BottomSheetDefaultBackdropProps) => {
//#region hooks
const { snapToIndex, close } = useBottomSheet();
Expand Down Expand Up @@ -104,7 +105,7 @@ const BottomSheetBackdropComponent = ({
[disappearsOnIndex]
);
//#endregion

return pressBehavior !== 'none' ? (
<TapGestureHandler onGestureEvent={gestureHandler}>
<Animated.View
Expand All @@ -116,14 +117,18 @@ const BottomSheetBackdropComponent = ({
accessibilityHint={`Tap to ${
typeof pressBehavior === 'string' ? pressBehavior : 'move'
} the Bottom Sheet`}
/>
>
{children}
</Animated.View>
</TapGestureHandler>
) : (
<Animated.View
ref={containerRef}
pointerEvents={pointerEvents}
style={containerStyle}
/>
>
{children}
</Animated.View>
);
};

Expand Down
4 changes: 4 additions & 0 deletions src/components/bottomSheetBackdrop/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ export interface BottomSheetDefaultBackdropProps
* @default 'close'
*/
pressBehavior?: BackdropPressBehavior;
/**
* Child component that will be rendered on backdrop.
*/
children?: React.ReactNode;
}