React-native-tab-view: Disabling swipe gestures on certain tabs

Created on 26 Nov 2017  路  2Comments  路  Source: satya164/react-native-tab-view

Expected behaviour

I'd like to be able to disable swipe to change tabs for a specific tab.

Reason: one of my tabs has a Tinder-style card swiper, and the gestures for swiping on the cards and changing tabs can conflict.

The swipe gesture is a fast and easy way for a user to switch tabs, so it would be useful to preserve this feature for the rest of my tabs.

Actual behaviour

The API for <TabViewPagerPan /> has a swipeEnabled prop but no way to disable for specific tabs.

What have you tried

Sorry, I have no idea how I could circumvent this. Is there some gesture "filter" that will funnel gestures only to a specific component?

I read the source code for TabViewPagerPan but couldn't find anything to solve this problem. I also carefully searched previous issues in this repo, and couldn't find anything similar.

Thank you for your help!

Most helpful comment

Have you tried setting swipeEnabled prop based on your state?

All 2 comments

Have you tried setting swipeEnabled prop based on your state?

Perfect. Thank you so much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ashusdn picture ashusdn  路  4Comments

satya164 picture satya164  路  3Comments

ahmedrowaihi picture ahmedrowaihi  路  3Comments

KingAmo picture KingAmo  路  3Comments

jouderianjr picture jouderianjr  路  3Comments