dancormier / react-native-swipeout

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

Swipe disabled when using TouchableWithoutFeedback #334

Closed mikeKane closed 5 years ago

mikeKane commented 5 years ago

Using the suggested example code found here https://github.com/dancormier/react-native-swipeout/blob/master/example/SwipeoutExample.js#L46

I am unable to swipe whenever I have TouchableWithoutFeedback enabled.

Here is my code:

    return (
      <Swipeout
        right={swipeoutBtns}
        rowID={0}
        sectionID={0}
        autoClose={true}
        backgroundColor="white"
        onOpen={(sectionID, rowID) => {
          this.setState({
            sectionID,
            rowID
          });
        }}
        onClose={() => console.log("===close")}
        scroll={event => console.log("scroll event")}
      >
        <TouchableWithoutFeedback onPress={() => console.log("press children")}>
          <View style={{ height: 100 }}>
            <Text style={styles.liText}>yo</Text>
          </View>
        </TouchableWithoutFeedback>
      </Swipeout>
    );

Any help would truly be appreciated. Thanks!

Heres my info if it helps

 react-native info
info 
  React Native Environment Info:
    System:
      OS: macOS 10.14.6
      CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
      Memory: 226.37 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.15.3 - /usr/local/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    IDEs:
      Android Studio: 3.4 AI-183.5429.30.34.5452501
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.4 => 0.59.4 
    npmGlobalPackages:
      create-react-native-app: 2.0.2
      react-native-cli: 2.0.1
kezhongsun commented 5 years ago

I sovled this problem by set the "sensitivity" property of the swipeout ,maybe you can set the value to 1.

mikeKane commented 5 years ago

This doesn’t seem to work.

Is anyone able to test the above code to see if it works?

mikeKane commented 5 years ago

Does it matter it is the content over an open drawer navigator?

mikeKane commented 5 years ago

Its does matter! For anyone who encounters this issue. If Swipeout is inside of a drawer navigator you must disable gestures on that navigation.

Inside of the navigation options add drawerLockMode: "locked-open"

Thanks again everyone for the help and a great lib!

bohehe commented 4 years ago

I sovled this problem by set the "sensitivity" property of the swipeout ,maybe you can set the value to 1.

works ok on ios, but not smoothly on android