diff --git a/Libraries/CustomComponents/NavigationExperimental/NavigationCard.js b/Libraries/CustomComponents/NavigationExperimental/NavigationCard.js index e023281d66..b01c3f0346 100644 --- a/Libraries/CustomComponents/NavigationExperimental/NavigationCard.js +++ b/Libraries/CustomComponents/NavigationExperimental/NavigationCard.js @@ -80,24 +80,44 @@ class NavigationCard extends React.Component { } render(): ReactElement { - let { - style, + const { panHandlers, renderScene, - ...props, + style, + ...props, /* NavigationSceneRendererProps */ } = this.props; + let viewStyle = null; if (style === undefined) { // fall back to default style. - style = NavigationCardStackStyleInterpolator.forHorizontal(props); + viewStyle = NavigationCardStackStyleInterpolator.forHorizontal(props); + } else { + viewStyle = style; } - if (panHandlers === undefined) { - // fall back to default pan handlers. - panHandlers = NavigationCardStackPanResponder.forHorizontal(props); + + const { + navigationState, + scene, + } = props; + + const interactive = navigationState.index === scene.index && !scene.isStale; + const pointerEvents = interactive ? 'auto' : 'none'; + + let viewPanHandlers = null; + if (interactive) { + if (panHandlers === undefined) { + // fall back to default pan handlers. + viewPanHandlers = NavigationCardStackPanResponder.forHorizontal(props); + } else { + viewPanHandlers = panHandlers; + } } return ( - + {renderScene(props)} );