File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ export default forwardRef<ActionSheetRef, ActionSheetProps>(
7979 overlayColor = 'black' ,
8080 closable = true ,
8181 closeOnTouchBackdrop = true ,
82+ onTouchBackdrop,
8283 drawUnderStatusBar = false ,
8384 gestureEnabled = false ,
8485 isModal = true ,
@@ -1125,6 +1126,7 @@ export default forwardRef<ActionSheetRef, ActionSheetProps>(
11251126
11261127 const onTouch = ( event : GestureResponderEvent ) => {
11271128 props . onTouchBackdrop ?.( event ) ;
1129+ onTouchBackdrop ?.( event ) ;
11281130 if ( enableRouterBackNavigation && router . canGoBack ( ) ) {
11291131 router . goBack ( ) ;
11301132 return ;
@@ -1146,6 +1148,7 @@ export default forwardRef<ActionSheetRef, ActionSheetProps>(
11461148
11471149 if ( orientationChanged ) isOrientationChanging . current = true ;
11481150
1151+
11491152 actionSheetHeight . current =
11501153 event . nativeEvent . layout . height > dimensionsRef . current . height
11511154 ? dimensionsRef . current . height
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from 'react';
22import {
33 Animated ,
44 GestureResponderEvent ,
5+
56 LayoutRectangle ,
67 TouchableOpacityProps ,
78 ViewStyle ,
@@ -56,6 +57,7 @@ export type ActionSheetRef<SheetId extends keyof Sheets = never> = {
5657 */
5758 currentSnapIndex : ( ) => number ;
5859
60+
5961 /**
6062 * Used internally for scrollable views.
6163 */
@@ -208,6 +210,13 @@ export type ActionSheetProps<SheetId extends keyof Sheets = never> = {
208210 */
209211 closeOnTouchBackdrop ?: boolean ;
210212
213+ /**
214+ * Callback when user touches the backdrop. Includes the GestureResponderEvent.
215+ *
216+ * Default: undefined
217+ */
218+ onTouchBackdrop ?: ( event : GestureResponderEvent ) => void ;
219+
211220 /**
212221 * Render a component over the ActionSheet. Useful for rendering
213222 * Toast components with which user can interact. Should be `absolutely` positioned.
You can’t perform that action at this time.
0 commit comments