Skip to content

Commit 806309b

Browse files
Silvallisammarahm-ed
authored andcommitted
fix(web): allow backgroundInteractionEnabled to work by setting pointerEvents
Adds pointerEvents: 'box-none' to the GestureHandlerRootView when backgroundInteractionEnabled is true, allowing background elements to receive pointer events on Web, consistent with Android behavior.
1 parent 1692cf6 commit 806309b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,10 @@ export default forwardRef<ActionSheetRef, ActionSheetProps>(
14771477
<Root {...rootProps}>
14781478
<GestureHandlerRoot
14791479
isModal={isModal}
1480-
style={styles.parentContainer}>
1480+
style={styles.parentContainer}
1481+
pointerEvents={
1482+
props?.backgroundInteractionEnabled ? 'box-none' : 'auto'
1483+
}>
14811484
<PanGestureRefContext.Provider value={context}>
14821485
<DraggableNodesContext.Provider value={draggableNodesContext}>
14831486
<Animated.View
@@ -1654,7 +1657,9 @@ export default forwardRef<ActionSheetRef, ActionSheetProps>(
16541657

16551658
const GestureHandlerRoot = (props: any) => {
16561659
return props.isModal ? (
1657-
<GestureHandlerRootView style={props.style}>
1660+
<GestureHandlerRootView
1661+
style={props.style}
1662+
pointerEvents={props.pointerEvents}>
16581663
{props.children}
16591664
</GestureHandlerRootView>
16601665
) : (

0 commit comments

Comments
 (0)