Bluesky app fork with some witchin' additions 💫

Fix full-screen back gesture over PagerView on iOS 26 (#9659)

Patches react-native-pager-view to handle iOS 26's
interactiveContentPopGestureRecognizer, using the same logic that
already exists for RNSPanGestureRecognizer: on the leftmost page,
disable the scrollview's pan gesture to let the back gesture through.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

authored by samuel.fm

Claude Opus 4.5 and committed by
GitHub
d82592f0 dae03312

+41
+30
patches/react-native-pager-view+6.8.0.patch
···
··· 1 + diff --git a/node_modules/react-native-pager-view/ios/RNCPagerView.m b/node_modules/react-native-pager-view/ios/RNCPagerView.m 2 + index adfc7c6..366df60 100644 3 + --- a/node_modules/react-native-pager-view/ios/RNCPagerView.m 4 + +++ b/node_modules/react-native-pager-view/ios/RNCPagerView.m 5 + @@ -498,6 +498,25 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecogni 6 + return YES; 7 + } 8 + 9 + + // iOS 26+ full-screen back gesture (interactiveContentPopGestureRecognizer) 10 + + if (@available(iOS 26, *)) { 11 + + if (gestureRecognizer == self.panGestureRecognizer && 12 + + otherGestureRecognizer == self.reactViewController.navigationController.interactiveContentPopGestureRecognizer) { 13 + + UIPanGestureRecognizer* panGestureRecognizer = (UIPanGestureRecognizer*) gestureRecognizer; 14 + + CGPoint velocity = [panGestureRecognizer velocityInView:self]; 15 + + BOOL isLTR = [self isLtrLayout]; 16 + + BOOL isBackGesture = (isLTR && velocity.x > 0) || (!isLTR && velocity.x < 0); 17 + + 18 + + if (self.currentIndex == 0 && isBackGesture) { 19 + + self.scrollView.panGestureRecognizer.enabled = false; 20 + + } else { 21 + + self.scrollView.panGestureRecognizer.enabled = self.scrollEnabled; 22 + + } 23 + + 24 + + return YES; 25 + + } 26 + + } 27 + + 28 + self.scrollView.panGestureRecognizer.enabled = self.scrollEnabled; 29 + return NO; 30 + }
+11
patches/react-native-pager-view+6.8.0.patch.md
···
··· 1 + # react-native-pager-view+6.8.0.patch 2 + 3 + Adds support for iOS 26's `interactiveContentPopGestureRecognizer` (full-screen back gesture). 4 + 5 + The pager already handles `RNSPanGestureRecognizer` (react-native-screens' custom full-screen gesture for pre-iOS 26) in `shouldRecognizeSimultaneouslyWithGestureRecognizer:`. It checks if the user is on the leftmost page and swiping right - if so, it disables the scrollview's pan gesture to let the back gesture through. 6 + 7 + This patch adds the same logic for iOS 26's native `interactiveContentPopGestureRecognizer`, so the back gesture works on the leftmost page while the pager still handles swipes on other pages. 8 + 9 + Related issues: 10 + - https://github.com/software-mansion/react-native-screens/issues/3512 11 + - https://github.com/software-mansion/react-native-screens/pull/3420