-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Inconsistent documentation: onShouldBlockNativeResponder
works on iOS
#40750
Inconsistent documentation: onShouldBlockNativeResponder
works on iOS
#40750
Conversation
While you can definitely set the property, the result is ignored on iOS. |
@javache This prop is not being completely ignored, as changing it to return For context, I am using a PanResponder inside a It may be ignored at the native level, but is this perhaps related to these lines which handle this in the JS level? I don't know enough about the workings to be absolutely sure. I may even be using the wrong prop – but so far this callback works for me on iOS and is extremely useful! |
OK, I've got it @javache – I figured out what caused this to work for me! It turns out I was using a library that implements For now, the solution will be to wrap my pan responder in a |
Yep – Last question – is there a deliberate reason this isn't implemented? Can/should it be? It's nice to finally be able to put pan responders into modal views like this. The gesture handler is a fine workaround, just wondering whether there's some deliberate decision not to implement this in RN itself. Thank you! |
Overriding UIManager methods like this is extremely fragile. This is guaranteed to break in the new architecture.
I think iOS' model for blocking other gestures is significantly different from how Android approaches this, it would be great to unify it though. We currently just have ad-hoc logic checking for responders, eg https://github.com/facebook/react-native/blob/main/packages/react-native/React/Views/ScrollView/RCTScrollView.m#L65-L75 |
Summary:
This line of the documentation says that
onShouldBlockNativeResponder
in PanResponder only works on Android. However, I just tried it and it seems to be working very nicely on iOS.Changelog:
[IOS] [FIXED] - Inconsistent documentation:
onShouldBlockNativeResponder
works on iOSTest Plan:
Code comment change only. No functional changes should require no testing