mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 12:45:37 +08:00
[ReactNative] Fix touch issue caused by D2036644 after swiping back
This commit is contained in:
@@ -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]),
|
||||||
|
|||||||
Reference in New Issue
Block a user