dancormier / react-native-swipeout

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

Elements with onPress capture swipe events #294

Open rollsroyc3 opened 6 years ago

rollsroyc3 commented 6 years ago

I am currently using a FlatList and am having issues with touch events. I saw the ticket here and have been testing myself over the last few hours. The issue seems to arise from setting the sensitivity value to high. Just wanted to post this in case anyone else has issues in the future.

mikeKane commented 5 years ago

Bump. This is an issue. Swipeout will swipe when TouchableWithoutFeedback is commented out but will not swipe if it is not commented out

 <Swipeout
        // autoClose={true}
        sensitivity={40}
        style={{ backgroundColor: "white" }}
        right={swipeoutBtns}
      >
        <TouchableWithoutFeedback onPress={() => this.selectResult(index)}>
        <View>
          <Results result={item} />
        </View>
        </TouchableWithoutFeedback>
      </Swipeout>
rollsroyc3 commented 5 years ago

@mikeKane Have you tried removing the sensitivity property?

mikeKane commented 5 years ago

Yes. Is it working for you now?

<Swipeout
        autoClose={true}
        onOpen={(sectionID, rowID) => {
          this.setState({
            sectionID,
            rowID
          });
          close = true;
        }}
        onClose={() => console.log("===close")}
        scroll={event => (close = false)}
        style={{ backgroundColor: "white" }}
        right={swipeoutBtns}
      >
        <TouchableWithoutFeedback onPress={() => this.selectResult(index)}>
          <View>
            <Results result={item} />
          </View>
        </TouchableWithoutFeedback>
      </Swipeout>

That is my latest code.

rollsroyc3 commented 5 years ago

Yeah removing sensitivity fixed my issue.

mikeKane commented 5 years ago

This issue wasn't solved for me by removing sensitivity. Are we able to reopen this?