Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close previous row on new swipe not working #603

Open
ibrar-web opened this issue Jun 22, 2022 · 8 comments
Open

Close previous row on new swipe not working #603

ibrar-web opened this issue Jun 22, 2022 · 8 comments

Comments

@ibrar-web
Copy link

<SwipeListView
data={custom}
renderItem={(data, rowMap) => (

{data.item.name}

)}
renderHiddenItem={(data, rowMap) => (


close


detail

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

            </SwipeListView>
@estebanrao
Copy link

Have you tried using closeOnRowBeginSwipe ?

@nobane
Copy link

nobane commented Jul 5, 2022

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.

@marry1822
Copy link

marry1822 commented Jul 15, 2022

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}
 />

@shahanshah87
Copy link

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

@muhammadmahad-debug
Copy link

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

@code-by
Copy link

code-by commented Jan 16, 2023

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

@D4RKBR4IN
Copy link

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

@SurajMohanty02
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants