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

Close previous row on new swipe not working

Open ibrar-web opened this issue 3 years ago • 8 comments

<SwipeListView data={custom} renderItem={(data, rowMap) => ( <View style={style.rowFront}> <Text style={styles.swipelistitem}>{data.item.name}</Text> </View> )} renderHiddenItem={(data, rowMap) => ( <View style={style.rowBack}> <TouchableOpacity style={style.rowBack.button}> <Text>close</Text> </TouchableOpacity> <TouchableOpacity style={style.rowBack.button}> <Text>detail</Text> </TouchableOpacity>

                    </View>
                )}
                leftOpenValue={200}
                rightOpenValue={-200}
            >

            </SwipeListView>

ibrar-web avatar Jun 22 '22 10:06 ibrar-web

Have you tried using closeOnRowBeginSwipe ?

estebanrao avatar Jun 27 '22 14:06 estebanrao

I had this problem recently.

The issue for me was that all my data items needed to have a unique key defined on them.

Make sure all the items in your custom data object have a unique key defined.

nobane avatar Jul 05 '22 18:07 nobane

Doesn't work with the unique key and closeOnRowOpen, closeOnRowBeginSwipe Still several rows are opened at the same time. How to fix it?

<SwipeListView
 closeOnRowOpen
 closeOnRowBeginSwipe
 keyExtractor={item => {
      item.id;
      }}
 data={sortedData()}
 renderItem={renderItem}
 renderHiddenItem={renderHiddenItem}
 rightOpenValue={-300}
 recalculateHiddenLayout={true}
 />

marry1822 avatar Jul 15 '22 09:07 marry1822

Doesn't work with the unique key and closeOnRowOpen, closeOnRowBeginSwipe Still several rows are opened at the same time. How to fix it?

<SwipeListView
 closeOnRowOpen
 closeOnRowBeginSwipe
 keyExtractor={item => {
      item.id;
      }}
 data={sortedData()}
 renderItem={renderItem}
 renderHiddenItem={renderHiddenItem}
 rightOpenValue={-300}
 recalculateHiddenLayout={true}
 />

replace id with key

shahanshah87 avatar Sep 22 '22 15:09 shahanshah87

@Shahanshah87 Sorry for being late but you need to remove bracly brackets or in brackets add return

muhammadmahad-debug avatar Nov 05 '22 10:11 muhammadmahad-debug

I have same problem with SwipeRow, how to automatically close row when begin swipe another one

code-by avatar Jan 16 '23 20:01 code-by

I have same problem with SwipeRow, how to automatically close row when begin swipe another one i have the same problem...

have you been able to resolve this? can you share? thanks

D4RKBR4IN avatar Mar 16 '23 10:03 D4RKBR4IN

Doesn't work with the unique key and closeOnRowOpen, closeOnRowBeginSwipe Still several rows are opened at the same time. How to fix it?

<SwipeListView
 closeOnRowOpen
 closeOnRowBeginSwipe
 keyExtractor={item => {
      item.id;
      }}
 data={sortedData()}
 renderItem={renderItem}
 renderHiddenItem={renderHiddenItem}
 rightOpenValue={-300}
 recalculateHiddenLayout={true}
 />

It is working

SurajMohanty02 avatar Apr 03 '23 07:04 SurajMohanty02