Skipperlla / rn-swiper-list

⚡ Lightning fast and customizable tinder-like swiper for React Native
https://www.npmjs.com/package/rn-swiper-list
MIT License
97 stars 9 forks source link

Support tap events on SwiperItem #15

Closed dancixx closed 3 weeks ago

dancixx commented 1 month ago

Hi, thanks for your work. Is it possible to support tap events for children elements, for example, show multiple images?!

danish5454 commented 1 month ago

You can warp FlatList horizontal direction in renderCard for multiple images and wrap that component in Pressable.

`const SwiperItem: React.FC = ({ item, onPress }) => { return (

);`

Skipperlla commented 1 month ago

@dancixx Is there a source you can cite as an example from anywhere? I don't quite understand what you mean

dancixx commented 1 month ago

@Skipperlla sorry for late answer, but I was able to solve this thing just needed to add a tap gesture detector to the child element.

danish5454 commented 1 month ago

@dancixx you cant not use GestureDetector because they already using Pan Gesture. try import { TapGestureHandler } from 'react-native-gesture-handler'; and wrap your each child to TapGestureHandler in renderCard callback

Skipperlla commented 4 weeks ago

If you explain what you want in a little detail, I can add it directly so you don't need to write extra code, if you have no other questions, I will close the issue @dancixx