meliorence / meliorence/react-native-snap-carousel

Best way to wrap carousel in a touchable?

Open
#423 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Is this a bug report, a feature request, or a question?

Question

I want my entire carousel to be touchable, while at the same letting users go through photos. I basically have a view with a carousel and a card in it, and I want that entire thing to be touchable.

so the code looks like

<TouchableOpacity>
  <View>
    <Carousel />
    <Card />
  </View>
</TouchableOpacity>

As soon as a touchable* is added, panning stops working on the carousel. If I swipe really fast the items are gone through, but otherwise the carousel is unresponsive.

Things I've tried:

  1. Setting onMoveShouldSetResponder={ () => false } on my TouchableOpacity
  2. Setting onMoveShouldSetResponder={() => true} on the carousel
  3. Setting onStartShouldSetResponder={() => true} on the carousel

Aside from completely ditching TouchableOpacity and setting up my own gesture detection using PanResponder, is there anything else I can do?

Thanks in advance for any help!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides only a TouchableOpacity, View, Carousel, and Card example, with no repository file or test named. Start by reproducing the nested-touchable behavior in the carousel and inspect how its gesture responder handles movement alongside TouchableOpacity. Done means swiping remains responsive while the entire carousel and card can still be touched.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.