react-native-swipe-list-view icon indicating copy to clipboard operation
react-native-swipe-list-view copied to clipboard

Swipe problems in Modal [iOS 13]

Open m-ruhl opened this issue 4 years ago • 7 comments

Hello 👋

Describe the bug If we use the swipe-list in a modal VC (iOS 13) we cannot swipe completely to the left.

swipe

We are using React-Native-Navigation 6.7.1

      <SwipeListView
        keyExtractor={(item, index) => item.identifier + String(index)}
        onRowOpen={this.bindingOnRowOpen}
        refreshing={false}
        ListEmptyComponent={this.createEmptyComponent}
        data={this.props.location.projectWeek}
        renderItem={this.bindingRenderItem}
        showsVerticalScrollIndicator={false}
        disableRightSwipe={true}
        rightOpenValue={-SwipeableWidth.DEFAULT}
        recalculateHiddenLayout={true}
        renderHiddenItem={this.bindingRenderHiddenItem}
      />

Environment (please complete the following information):

  • OS: iOS 13
  • RNSLV Version: 3.1.0
  • RN Version: 0.61.4

Any ideas to solve this problem?

Thanks Michael

m-ruhl avatar May 30 '20 12:05 m-ruhl

Hey @m-ruhl, there are a lot of reported problems with interoperability between this library and react-navigation. Because of all the swipe gestures to navigate their library will often become the first responder when a user starts a gesture and I'm not sure if they allow you to override that? A quick search of the docs didn't reveal anything but maybe I missed something.. ? Sorry it's not a better answer

jemise111 avatar May 31 '20 21:05 jemise111

This isn't specific to react-navigation. I ran into this problem with react-native's <Modal> component.

Wrapping the Swipe List in a PanGestureHandler seems capture the touch before it gets to the underlaying Modal.

try:

<PanGestureHandler enabled={true}>
      <SwipeListView
        keyExtractor={(item, index) => item.identifier + String(index)}
        onRowOpen={this.bindingOnRowOpen}
        refreshing={false}
        ListEmptyComponent={this.createEmptyComponent}
        data={this.props.location.projectWeek}
        renderItem={this.bindingRenderItem}
        showsVerticalScrollIndicator={false}
        disableRightSwipe={true}
        rightOpenValue={-SwipeableWidth.DEFAULT}
        recalculateHiddenLayout={true}
        renderHiddenItem={this.bindingRenderHiddenItem}
      />
</PanGestureHandler>

Synvox avatar Jul 24 '20 22:07 Synvox

PanGestureHandler

I try it, but still not working :(

Duya3fithou avatar Sep 06 '20 11:09 Duya3fithou

I'm having the same problem with react-native-modal in Android, if you are using react-native-modal, you need to make sure that the attribute swipeDirection="down" of react-native-modal is not enabled. It's a bit annoying, how can I achieve both swipe down gesture for the modal and swipe left/right of list view :(

nathantqn avatar Sep 09 '20 06:09 nathantqn

Hi @m-ruhl, did you find a solution for this?

nathantqn avatar Sep 15 '20 09:09 nathantqn

Quick solution of this is to disable the modal drag gesture, this way the swipe row will receive the gesture and will work accordingly. Add the drag gesture of Modal on Header or top component so that you are able to drag the Modal as well

akhatriST avatar Nov 23 '20 08:11 akhatriST

I'm having the same problem, but in my case is with TabView -> 'react-native-tab-view'. All the other places that I'm using the swipe works perfectly. Do you guys have any idea of what can I do?

React Native: 0.72 TabView: 3.5 Swipe List: 3.2

https://github.com/jemise111/react-native-swipe-list-view/assets/127544961/7b2d89e7-2f74-4a72-8559-c674c81e3832

thanks, André

Andre-Capelli avatar Jul 05 '23 11:07 Andre-Capelli