diff --git a/package.json b/package.json index 70873703ef..ea20ae4c75 100644 --- a/package.json +++ b/package.json @@ -226,7 +226,7 @@ "react-native-device-attest": "^0.1.6", "react-native-drawer-layout": "^4.2.3", "react-native-edge-to-edge": "^1.8.1", - "react-native-gesture-handler": "~2.28.0", + "react-native-gesture-handler": "~2.30.0", "react-native-keyboard-controller": "^1.21.8", "react-native-mmkv": "^3.3.3", "react-native-pager-view": "6.8.0", diff --git a/patches/react-native-gesture-handler.patch b/patches/react-native-gesture-handler.patch new file mode 100644 index 0000000000..b8a22cf6a5 --- /dev/null +++ b/patches/react-native-gesture-handler.patch @@ -0,0 +1,31 @@ +diff --git a/apple/RNGestureHandler.mm b/apple/RNGestureHandler.mm +index c4f760c41a9965245edcfa5e7cb781f8d2c7b66a..bf7d1fb092e22cbcedf787e606876e533879f810 100644 +--- a/apple/RNGestureHandler.mm ++++ b/apple/RNGestureHandler.mm +@@ -470,15 +470,19 @@ + (RNGestureHandler *)findGestureHandlerByRecognizer:(UIGestureRecognizer *)reco + + // We may try to extract "DummyGestureHandler" in case when "otherGestureRecognizer" belongs to + // a native view being wrapped with "NativeViewGestureHandler" +- RNGHUIView *reactView = recognizer.view; +- while (reactView != nil && reactView.reactTag == nil) { +- reactView = reactView.superview; +- } ++ RNGHUIView *view = recognizer.view; ++ while (view != nil) { ++ for (UIGestureRecognizer *candidateRecognizer in view.gestureRecognizers) { ++ if ([candidateRecognizer isKindOfClass:[RNDummyGestureRecognizer class]]) { ++ return candidateRecognizer.gestureHandler; ++ } ++ } + +- for (UIGestureRecognizer *recognizer in reactView.gestureRecognizers) { +- if ([recognizer isKindOfClass:[RNDummyGestureRecognizer class]]) { +- return recognizer.gestureHandler; ++ if ([view isKindOfClass:[RCTViewComponentView class]]) { ++ return nil; + } ++ ++ view = view.superview; + } + + return nil; diff --git a/patches/react-native-gesture-handler.patch.md b/patches/react-native-gesture-handler.patch.md new file mode 100644 index 0000000000..557823a23b --- /dev/null +++ b/patches/react-native-gesture-handler.patch.md @@ -0,0 +1,5 @@ +# react-native-gesture-handler.patch + +Updated `findGestureHandlerByRecognizer:` in `apple/RNGestureHandler.mm` to the version from RN GH 2.32.0 + +This fixes `UIContextMenuInteraction` from `ExpoBlueskyPeekMenuView.swift`. https://github.com/software-mansion/react-native-gesture-handler/commit/fba4dcc06d71dce08b10b2afc738a2af5b01e86a diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index bfc2581de4..d359291490 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -34,6 +34,7 @@ patchedDependencies: 'react-native-compressor@1.13.0': patches/react-native-compressor@1.13.0.patch 'react-native-date-picker@5.0.13': patches/react-native-date-picker@5.0.13.patch 'react-native-drawer-layout@4.2.3': patches/react-native-drawer-layout@4.2.3.patch + react-native-gesture-handler: patches/react-native-gesture-handler.patch 'react-native-keyboard-controller@1.21.8': patches/react-native-keyboard-controller@1.21.8.patch 'react-native-pager-view@6.8.0': patches/react-native-pager-view@6.8.0.patch 'react-native-reanimated@4.3.2': patches/react-native-reanimated@4.3.2.patch