meliorence / meliorence/react-native-snap-carousel
Best way to wrap carousel in a touchable?
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:
- Setting
onMoveShouldSetResponder={ () => false }on my TouchableOpacity - Setting
onMoveShouldSetResponder={() => true}on the carousel - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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