[ReactNative] Navigator block touches to non-active scenes

Summary:
When tapping a link quickly, it will cause two scenes to be pushed on. This prevents against that case by swallowing touches for all non-active scenes.

@public

Test Plan: Can no longer double-push scenes
This commit is contained in:
Eric Vicenti 2015-04-30 15:53:27 -07:00
parent e5f47731c6
commit 76dc14684d
1 changed files with 12 additions and 6 deletions

View File

@ -1176,12 +1176,18 @@ var Navigator = React.createClass({
var scene = shouldRenderScene ?
this._renderScene(route, i, sceneNavigatorContext) : null;
return (
<NavigatorStaticContextContainer
navigatorContext={sceneNavigatorContext}
key={'nav' + i}
shouldUpdate={shouldRenderScene}>
{scene}
</NavigatorStaticContextContainer>
<View
style={styles.defaultSceneStyle}
onStartShouldSetResponder={() => (
i !== this.state.presentedIndex
)}>
<NavigatorStaticContextContainer
navigatorContext={sceneNavigatorContext}
key={'nav' + i}
shouldUpdate={shouldRenderScene}>
{scene}
</NavigatorStaticContextContainer>
</View>
);
},