diff --git a/src/views/CardStack/CardStack.js b/src/views/CardStack/CardStack.js index 03ca6b101d..d37b62925e 100644 --- a/src/views/CardStack/CardStack.js +++ b/src/views/CardStack/CardStack.js @@ -103,9 +103,6 @@ const animatedSubscribeValue = (animatedValue: Animated.Value) => { }; class CardStack extends React.Component { - static defaultProps = { - globalGesturesEnabled: Platform.OS === 'ios', - }; /** * Used to identify the starting point of the position when the gesture starts, such that it can * be updated according to its relative position. This means that a card can effectively be @@ -260,6 +257,11 @@ class CardStack extends React.Component { if (index !== scene.index) { return false; } + // $FlowFixMe + const { getIsBackNavigationEnabled } = this.props.navigation; + if (typeof getIsBackNavigationEnabled === 'function') { + if (!getIsBackNavigationEnabled()) return false; + } const immediateIndex = this._immediateIndex == null ? index : this._immediateIndex; const currentDragDistance = gesture[isVertical ? 'dy' : 'dx']; @@ -358,13 +360,12 @@ class CardStack extends React.Component { }); const { options } = this._getScreenDetails(scene); - const screenGesturesEnabled = - typeof options.gesturesEnabled === 'boolean' && options.gesturesEnabled; const gesturesEnabled = - this.props.globalGesturesEnabled && screenGesturesEnabled; + typeof options.gesturesEnabled === 'boolean' && options.gesturesEnabled; - const handlers = gesturesEnabled ? responder.panHandlers : {}; + const handlers = + gesturesEnabled && Platform.OS === 'ios' ? responder.panHandlers : {}; const containerStyle = [ styles.container, this._getTransitionConfig().containerStyle,