React-native-swipe-list-view: Is there a way to trigger a function on swipe

Created on 8 May 2017  路  5Comments  路  Source: jemise111/react-native-swipe-list-view

That is - I want my rows to function like the ios mail app. When I pull a row all the way to the left, I want to delete that item. As far as I can see based on the props, this does not seem possible. Unless I'm missing something...

Returning the e.target here could return coordinates to make it possible:
screen shot 2017-05-08 at 11 07 23 pm

Most helpful comment

As of v1.5.0 onSwipeValueChange prop has been added. You can now take actions based on the swipe value of the row. Going to close this issue but please re-open if anyone has other questions, thanks!

All 5 comments

+1

Hey @terencestone unfortunately that functionality isn't supported right now. Happy to look at a PR if you want to take a crack at it :)

I think you're on the right track. The swipe row could accept a callback to run when a row has been swiped more than, let's say, 75% of the way across. In that function (handlePanResponderMove) you could check what % of the way the row has been swiped and run the callback when necessary.

The tricky thing about achieving iOS mail-like behavior is that it's very difficult to animate deleting a row in react-native. But it's worth a shot..

(sorry for the delay in responding!)

Hi @terencestone, any progress on this? Any workaround? Thanks

@terencestone have you found a solution?

As of v1.5.0 onSwipeValueChange prop has been added. You can now take actions based on the swipe value of the row. Going to close this issue but please re-open if anyone has other questions, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kyangy picture kyangy  路  3Comments

jjhesk picture jjhesk  路  3Comments

lsbiosite picture lsbiosite  路  6Comments

baicuhaha picture baicuhaha  路  6Comments

nzrin picture nzrin  路  5Comments