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

PanResponder vs ViewPager #186

Open
enigmablue opened this issue Mar 28, 2020 · 0 comments
Open

PanResponder vs ViewPager #186

enigmablue opened this issue Mar 28, 2020 · 0 comments

Comments

@enigmablue
Copy link

Hi,

As soon as we put in a PanResponder, the swipe gesture fails in the ViewPager.
Any one knows why?

  const panResponder = PanResponder.create({
      onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
        onPanResponderGrant: ({ nativeEvent: { touches } }, { x0 }) =>{
            if (this.state.horizontalShares.length > 0 && (x0 > (Dimensions.get('window').width / 1.3))){
                this.setState({moveHorizontal: "next"})
            }
            if (this.state.horizontalShares.length > 0 && this.state.horizontalIndex !== 0 &&
                (x0 < (Dimensions.get('window').width / 1.3))) {
                    this.setState({moveHorizontal: "back"})
            }
        }
    });
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

1 participant