Skip to content

Drawer swipe gesture steals all events from PanResponder > 10px delta #2352

@benogle

Description

@benogle

Issue Description

onPanResponderMove only called for 10px or so (the slop threshold, I assume), then the drawer gesture takes over. No other PanResponder lifecycle events are called after it takes over.

screen shot 2017-12-14 at 6 12 08 pm

Disabling the drawer gesture with disableOpenGesture fixes this. But we'd like to keep the drawer gesture.

Steps to Reproduce / Code Snippets / Screenshots

Create a single page app with a drawer and the swipe gesture enabled. Create a component with this pan responder in the root component:

this._panResponder = PanResponder.create({
  onStartShouldSetPanResponder: () => true,
  onStartShouldSetPanResponderCapture: () => true,

  onMoveShouldSetPanResponder: () => true,
  onMoveShouldSetPanResponderCapture: () => true,

  onPanResponderMove: (e, gestureState) => {
    console.log('onPanResponderMove', gestureState.dx, gestureState.dy)
  },
  onPanResponderGrant: (evt, gestureState) => {
    console.info('onPanResponderGrant')
  },
  onPanResponderReject: evt => {
    console.info('onPanResponderReject')
  },
  onPanResponderTerminationRequest: () => {
    console.log('onPanResponderTerminationRequest')
    return false
  },
  onShouldBlockNativeResponder: () => true,
})

Try to swipe down on your component.


Environment

  • React Native Navigation version: 1.1.309
  • React Native version: 0.50.0
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): iphone 6 simulator debug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions