marekrozmus / react-swipeable-list

Swipeable list component for React supporting several behaviours (e.g. iOS)
https://marekrozmus.github.io/react-swipeable-list/
MIT License
110 stars 20 forks source link

Is it possible to use button list item inside SwipeableListItem? #21

Closed vmashnitskaya closed 2 years ago

vmashnitskaya commented 2 years ago

Hello, thank you for this component!

I wonder if it is possible to use the button list item inside SwipeableListItem? So that I have swipe functionality as well as the possibility to click on the list item and e.g. open a new page. I have experimented differently with this and have not found the possibility to make this ending up with onClick button callback triggered as soon as swipe is performed.

marekrozmus commented 2 years ago

Hi :)

The list item onClick is there and seems to work: https://marekrozmus.github.io/react-swipeable-list/

Please open dev console and try to click items - you'll get [handle on click] with index.

Or am I missing something?

Let me know with some more details and maybe some code snippet :)

vmashnitskaya commented 2 years ago

Strangely enough, I was not able to achieve the desired result, but after your answer - yes, maybe missed something.

Thank you very much for your answer :)