Skip to content

Commit 0d0a732

Browse files
committed
react-native: map panGestureHandlerProps.simultaneousHandlers to Gesture.Pan().simultaneousWithExternalGesture to restore simultaneous ScrollView coordination on Android
1 parent a86638c commit 0d0a732

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

packages/design-system-react-native/src/components/BottomSheetDialog/BottomSheetDialog.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,17 @@ const applyPanGestureProps = (
114114
);
115115
}
116116

117+
// Map v1 PanGestureHandler prop to v2 Gesture API:
118+
// Forward simultaneousHandlers so pan can coordinate with e.g. ScrollView on Android.
119+
if (panGestureHandlerProps.simultaneousHandlers !== undefined) {
120+
const handlers = Array.isArray(panGestureHandlerProps.simultaneousHandlers)
121+
? panGestureHandlerProps.simultaneousHandlers
122+
: [panGestureHandlerProps.simultaneousHandlers];
123+
// Use external gesture composition since handler refs typically come from native components (e.g., ScrollView)
124+
// Casting to any to support ref types from RNGH v1 prop surface.
125+
gesture.simultaneousWithExternalGesture(...(handlers as any[]));
126+
}
127+
117128
return gesture;
118129
};
119130

0 commit comments

Comments
 (0)