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

onPanResponderTerminationRequest is not working. #5696

Closed
jihopark opened this issue Feb 2, 2016 · 10 comments
Closed

onPanResponderTerminationRequest is not working. #5696

jihopark opened this issue Feb 2, 2016 · 10 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@jihopark
Copy link

jihopark commented Feb 2, 2016

I want to make onPanResponderTerminationRequest: (evt, gestureState)=>false,

so that parent ListView won't take away the gesture but it doesn't seem like working properly..

Does anyone know why? I am looking into the library but still cannot find why.

@facebook-github-bot
Copy link
Contributor

Hey jihopark, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If you don't know how to do something or something is not working as you expect but not sure it's a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!

@rpastorelle
Copy link
Contributor

I seem to be experiencing this as well. I have some draggable Accessory components on top of the ViewPagerAndroid component. When dragging an Accessory component horizontally the lifecycle method onShouldBlockNativeResponder is called but return value is not respected. onPanResponderTerminate is called and the ViewPagerAndroid takes over. onPanResponderTerminationRequest was never called.

@christopherdro
Copy link
Contributor

@facebook-github-bot bugfix

@facebook-github-bot
Copy link
Contributor

Hey @jihopark, we're a small team and rely on the community to fix issues that don't affect fb apps. If you're sure this is a bug can you send a pull request with a fix?

@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Apr 10, 2016
@smallpath
Copy link

@rpastorelle I'm running into the same problem with ViewPagerAndroid. onPanResponderTerminationRequest is never called. Do you solve the problem?

@ericpalakovichcarr
Copy link
Contributor

ericpalakovichcarr commented Oct 15, 2016

I'm running into a similar problem. I have a View with a PanResponder that sits inside of a ScrollView. My onShouldBlockNativeResponder handler is getting ran, but the return value gets ignored. And I can't get the onPanResponderTerminationRequest to ever get called. I can go into more detail if needed.

Any movement anywhere on looking into this or solving it? Have anyone who previously posted here find a solution?

@rpastorelle
Copy link
Contributor

@smallpath It was a while ago but I believe this was the hack that hid the problem for me:

onMoveShouldSetPanResponder: (e, gestureState) => {
        if (
          Platform.OS == 'android'
          && (gestureState.dx < 1 && gestureState.dx > -1)
          && (gestureState.dy < 1 && gestureState.dy > -1)
        ) {
          return false;
        }

        return true;
}

@teameh
Copy link
Contributor

teameh commented Oct 18, 2016

I was having the same problem. onPanResponderTerminate gets called immediately when the user scrolls the parent's ListView..

I checked the source code and found this:

Scrolled views automatically become responder. The reasoning is that a platform scroll view that isn't built on top of the responder system has began scrolling, and the active responder must now be notified that the interaction is no longer locked to it - the system has taken over.

https://github.com/facebook/react/blob/master/src/renderers/shared/stack/event/eventPlugins/ResponderEventPlugin.js#L151-L154

So I think that explains why the ListView takes over...

@aymericbouzy
Copy link

Not sure if that's the correct answer, but shouldn't you add scrollEnabled={false} to your ListView while you are handling the gesture ?

@hramos
Copy link
Contributor

hramos commented May 25, 2017

Closing this issue because it has been inactive for a while. If you think it should still be opened let us know why.

@hramos hramos closed this as completed May 25, 2017
@hramos hramos added the Icebox label May 26, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

10 participants