react-native-tab-view icon indicating copy to clipboard operation
react-native-tab-view copied to clipboard

Change gestureHandlerProps based on value, dynamically or via State

Open stephanoparaskeva opened this issue 5 years ago • 4 comments

Example

For example, if one wanted to do something like this:

    <TabView
      navigationState={{ index, routes }}
      swipeEnabled={index !== 3}
      gestureHandlerProps={{ failOffsetX: index === 2 ? 1 : -1  }}
      renderScene={renderScene}
      onIndexChange={setIndex}
      initialLayout={initialLayout}
    />

Reasoning

It would allow one to have more control over the panhandler and allow things like:

  • Limiting the direction of the swipe based on index
  • Changing the props for animation based on state

Environment

"react-native": "0.62.2",
"react-native-gesture-handler": "^1.6.1",
"react-native-tab-view": "^2.14.4",

Current behaviour

With the given example, I can swipe left on all tabs but not right.

Expected behaviour

In the example, I should be able to swipe left on all tabs, and not right (working). But at index === 2 I should be able to swipe left AND right (not working).

stephanoparaskeva avatar Jun 07 '20 01:06 stephanoparaskeva

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • react-native-tab-view (found: 2.14.0, latest: 2.14.4)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

github-actions[bot] avatar Jun 07 '20 01:06 github-actions[bot]

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • react-native-tab-view (found: 2.14.0, latest: 2.14.4)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

Yes I can verify that the current version still has this issue even after updating to 2.14.4.

stephanoparaskeva avatar Jun 07 '20 01:06 stephanoparaskeva

Any update on this issue? Gesturehandlerprops doesn't seem to work for me still

kevin-carlson avatar Oct 08 '20 16:10 kevin-carlson

Can you describe it a bit more? "For example, if one wanted to do something like this:", that code is currently valid, is there a bug? Or is there something else you need to acheive?

satya164 avatar Jul 29 '21 12:07 satya164