jemise111 / react-native-swipe-list-view

A React Native ListView component with rows that swipe open and closed
https://www.npmjs.com/package/react-native-swipe-list-view
MIT License
2.79k stars 527 forks source link

How to prevent text from leaving the screen when swiping to delete? #470

Closed RayRojasGit closed 4 years ago

RayRojasGit commented 4 years ago

Hello when I swipe left to delete an item, the texts in my case are one word so they leave the screen, I would like to prevent that, is it possible to achieve the behavior? Thanks!

jemise111 commented 4 years ago

Hi @RayRojasGit I'm not sure I understand the question, can you elaborate a bit please? Thanks

RayRojasGit commented 4 years ago

Sure, I have a list of items, it's a vertical list. The delete behavior works fantastic. When you do the gesture to delete the item, you have to swipe to the left. What happens is that the contents inside my row for example a text like 'Cats', moves to the left too. They end up disappearing from the screen, just visually, then the delete button is shown, and I'm left with a blank row or the half of a word (because the word moved out of the screen) . I would like to know if it is possible to keep my text on the row showing all the time, without moving it to the left, while I can still swipe on the row and show the delete button.

jemise111 commented 4 years ago

Hey @RayRojasGit, if I"m understanding you correctly I don't think that is really possible with this library. All of the animating and gesture handling happens on the topmost container for the row. You would need to absolutely position your text on top of that parent container but I don't think it would play well with this library :(

I'll keep trying to think of a way to make this work

RayRojasGit commented 4 years ago

Alright thank you very much for the feedback (;. Best wishes.

jemise111 commented 4 years ago

Closing as resolved