react-native-swipe-list-view
react-native-swipe-list-view copied to clipboard
Close previous row on new swipe not working
<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>
Have you tried using closeOnRowBeginSwipe ?
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.
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}
/>
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 Sorry for being late but you need to remove bracly brackets or in brackets add return
I have same problem with SwipeRow, how to automatically close row when begin swipe another one
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
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