dancormier / react-native-swipeout

iOS-style swipeout buttons behind component
MIT License
2.62k stars 649 forks source link

Want the FlatList to be still when swipe. #182

Open gezichenshan opened 7 years ago

gezichenshan commented 7 years ago

It is a fabulous work!

  1. But the 1st thing embarrassed me is that the FlatList can't be still when I do a swipe.

  2. And the 2nd is that the swipe btns cannot be removed when I clicked another row or blank space.

I read the source code about the PanResponder:

...
componentWillMount: function() {
    this._panResponder = PanResponder.create({
      onStartShouldSetPanResponder: (event, gestureState) => true,
      onStartShouldSetPanResponderCapture: (event, gestureState) =>
        this.state.openedLeft || this.state.openedRight,
      onMoveShouldSetPanResponder: (event, gestureState) =>
        Math.abs(gestureState.dx) > this.props.sensitivity &&
        Math.abs(gestureState.dy) <= this.props.sensitivity,
      onPanResponderGrant: this._handlePanResponderGrant,
      onPanResponderMove: this._handlePanResponderMove,
      onPanResponderRelease: this._handlePanResponderEnd,
      onPanResponderTerminate: this._handlePanResponderEnd,
      onShouldBlockNativeResponder: (event, gestureState) => false,
      onPanResponderTerminationRequest: () => false,
    });
  },
...

It seem that the onPanResponderTerminationRequest: () => false doesn't reject the gesture of FlatList's scroll?

gezichenshan commented 7 years ago

It seems that I am in a same trouble as #179 .