Skip to content
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

onShouldBlockNativeResponder #71

Closed
lukahc opened this issue Sep 11, 2023 · 5 comments
Closed

onShouldBlockNativeResponder #71

lukahc opened this issue Sep 11, 2023 · 5 comments

Comments

@lukahc
Copy link

lukahc commented Sep 11, 2023

Currently the zoomable view conflicts with other packages like react native tab view because of line 130 in src/ReactNativeZoomableView.tsx:

onShouldBlockNativeResponder: () => false,

This line can lead to the PanResponder being terminated if there are other instances of PanResponder, meaning that the zoomable view can't pan or zoom properly, if at all. Could you please fix this, either by changing false to true, or just by making onShouldBlockNativeResponder an optional prop?

@elliottkember
Copy link
Collaborator

Hi! This sounds like a great candidate for a pull request. If you are able to fix the problem in a PR, please submit it and we'll take a look.

@elliottkember
Copy link
Collaborator

@lukahc Thank you for the help! Turns out I needed this functionality almost immediately. Very useful.

Do you think this should be true by default? It seems like it would always be a good idea for it to block pan responders.

@lukahc
Copy link
Author

lukahc commented Oct 12, 2023

@lukahc Thank you for the help! Turns out I needed this functionality almost immediately. Very useful.

Do you think this should be true by default? It seems like it would always be a good idea for it to block pan responders.

I agree, I can't think of many scenarios where it would be better for it to be false, I can make a PR for that change

@lukahc
Copy link
Author

lukahc commented Oct 12, 2023

@elliottkember #75

@elliottkember
Copy link
Collaborator

Nice – I think that should be fine.

An interesting note: onShouldBlockPanResponder is only implemented on Android.

However, I found that it was working on iOS too, but only because I happened to be using a react-native-gesture-handler wrapper. That library overrides UIManager to make this work. More info here: facebook/react-native#40750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants