Skip to content

PanResponder vs ViewPager #186

@enigmablue

Description

@enigmablue

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"})
            }
        }
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions