Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Want the FlatList to be still when swipe. #182

Open
gezichenshan opened this issue Jun 13, 2017 · 1 comment
Open

Want the FlatList to be still when swipe. #182

gezichenshan opened this issue Jun 13, 2017 · 1 comment

Comments

@gezichenshan
Copy link

gezichenshan commented Jun 13, 2017

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
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant