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

SwipeRow : Unable to close row programatically. #618

Open
yubarajoli77 opened this issue Apr 11, 2023 · 3 comments
Open

SwipeRow : Unable to close row programatically. #618

yubarajoli77 opened this issue Apr 11, 2023 · 3 comments

Comments

@yubarajoli77
Copy link

Here is my implementation. I am using this SwipeRow only (Standalone without SwipeListView).

<SwipeRow
      disableRightSwipe
      onRowPress={onPress}
      onRowOpen={onRowOpen}
      useNativeDriver
      rightOpenValue={-160}>
      <BackView
        isCompleted={Boolean(status.isDone)}
        isProcessing={processing}
      />
      {children}
    </SwipeRow>
const onRowOpen = async (toValue: number) => {
    setProcessing(true);
    if (status.isDone) {
      await unmark();
    } else {
      await mark();
    }
    setProcessing(false);
  };

Now I just want to close the Row automatically after successful execution of "mark" or "unmark" async function. How can I close that opened row programmatically?

You can see the screen recording below. I have to close it manually by swiping right.

Swipe.mov
@baargava
Copy link

did u solve the issue?

@mmaass
Copy link

mmaass commented May 22, 2024

For anyone wondering this is the gardening app Plantura. :D Can recommend.

@baargava I've just found the view in question in the app and the SwipeRow isn't there, so i guess no solution was found or the idea as a whole was scrapped.

as for a solution, use ref + closeRow(). see here

@yubarajoli77
Copy link
Author

@mmaass Thank you so much for recommending the Plantura gardening app :). We're thrilled to hear that you're enjoying it :D. Regarding the SwipeRow feature, the idea has been put on hold till now.

For those looking for a solution in similar scenarios, you can use useRef as mentioned by @mmaass

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

3 participants