[ReactNative] Fix touch issue caused by D2036644 after swiping back

This commit is contained in:
Eric Vicenti 2015-05-01 16:19:27 -07:00
parent 6abf37b47e
commit 5453be2ab2

View File

@ -1176,18 +1176,12 @@ var Navigator = React.createClass({
var scene = shouldRenderScene ? var scene = shouldRenderScene ?
this._renderScene(route, i, sceneNavigatorContext) : null; this._renderScene(route, i, sceneNavigatorContext) : null;
return ( return (
<View <NavigatorStaticContextContainer
style={styles.defaultSceneStyle} navigatorContext={sceneNavigatorContext}
onStartShouldSetResponder={() => ( key={'nav' + i}
i !== this.state.presentedIndex shouldUpdate={shouldRenderScene}>
)}> {scene}
<NavigatorStaticContextContainer </NavigatorStaticContextContainer>
navigatorContext={sceneNavigatorContext}
key={'nav' + i}
shouldUpdate={shouldRenderScene}>
{scene}
</NavigatorStaticContextContainer>
</View>
); );
}, },
@ -1202,6 +1196,9 @@ var Navigator = React.createClass({
<View <View
key={this.state.idStack[i]} key={this.state.idStack[i]}
ref={'scene_' + i} ref={'scene_' + i}
onStartShouldSetResponderCapture={() => {
return i !== this.state.presentedIndex;
}}
style={[initialSceneStyle, this.props.sceneStyle]}> style={[initialSceneStyle, this.props.sceneStyle]}>
{React.cloneElement(child, { {React.cloneElement(child, {
ref: this._handleItemRef.bind(null, this.state.idStack[i]), ref: this._handleItemRef.bind(null, this.state.idStack[i]),