-
-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manual Activation Gestures eats first touch input after foregrounding on iOS. #3205
Comments
I don't have a 100% confirmation on this, but I think this is an issue that only appears on iOS 18.1 |
I was also able to reproduce it on iOS 16.7. |
I ran into this too. I'm not sure whether this is addressing the root issue — may also want guards for macOS — but here's a patch that resolves it: diff --git a/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm b/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm
index 43d11b4..276024c 100644
--- a/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm
+++ b/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm
@@ -390,12 +390,28 @@ - (void)setManualActivation:(BOOL)manualActivation
if (_recognizer.view != nil) {
[_recognizer.view addGestureRecognizer:_manualActivationRecognizer];
}
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(handleAppWillResignActive:)
+ name:UIApplicationWillResignActiveNotification
+ object:nil];
} else if (_manualActivationRecognizer != nil) {
+ [[NSNotificationCenter defaultCenter] removeObserver:self
+ name:UIApplicationWillResignActiveNotification
+ object:nil];
[_manualActivationRecognizer.view removeGestureRecognizer:_manualActivationRecognizer];
_manualActivationRecognizer = nil;
}
}
+- (void)handleAppWillResignActive:(NSNotification *)notification
+{
+ if (_manualActivationRecognizer != nil && _manualActivationRecognizer.enabled) {
+ _manualActivationRecognizer.enabled = NO;
+ _manualActivationRecognizer.enabled = YES;
+ }
+}
+
- (void)bindManualActivationToView:(RNGHUIView *)view
{
if (_manualActivationRecognizer != nil) { Was seeing the issue with this gesture: Gesture.Simultaneous(Gesture.Pan().manualActivation(true), Gesture.Native()) Which is used here with an |
Could you check whether this PR (#3273) solves the problem in your case? |
Description
Let's create a simple barebones app that uses a manually activated pan gesture handler.
Steps to reproduce
react-native-screens
or something.You will observe that the first swipe does not register. We don't see any overscroll effect on the ScrollView. A second swipe will have the proper effect and feedback.
PXL.Nov.9.2024.mp4
From some light debugging I've done I noticed that:
enabled(false)
) still cause this problem.manualActivation(false)
gestures do not have this problem.hitSlop({bottom: -100})
does not fix the issue either.That's about all the debugging I've done so far, and please double check my work. :)
Snack or a link to a repository
https://github.com/tpcstld/rn-stuff/blob/scrolling-repro/app/_layout.tsx
Gesture Handler version
2.20.2
React Native version
0.74.5
Platforms
iOS
JavaScript runtime
None
Workflow
None
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
Real device
Device model
iPhone 16 Pro
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: