mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-02 09:08:58 +08:00
[ReactNative][Navigator] Fix disabled scene height change
Summary: Disabling the scene this way would make the scene height go to zero and mess up the scroll position. By setting the bottom to the same distance, the view does not get resized and the scroll position is preserved through a scene disable cycle.
This commit is contained in:
@@ -59,6 +59,7 @@ var SCENE_DISABLED_NATIVE_PROPS = {
|
||||
pointerEvents: 'none',
|
||||
style: {
|
||||
top: SCREEN_HEIGHT,
|
||||
bottom: -SCREEN_HEIGHT,
|
||||
opacity: 0,
|
||||
},
|
||||
};
|
||||
@@ -109,6 +110,7 @@ var styles = StyleSheet.create({
|
||||
},
|
||||
disabledScene: {
|
||||
top: SCREEN_HEIGHT,
|
||||
bottom: -SCREEN_HEIGHT,
|
||||
},
|
||||
transitioner: {
|
||||
flex: 1,
|
||||
@@ -535,6 +537,7 @@ var Navigator = React.createClass({
|
||||
pointerEvents: 'auto',
|
||||
style: {
|
||||
top: sceneStyle.top,
|
||||
bottom: sceneStyle.bottom,
|
||||
},
|
||||
};
|
||||
if (sceneIndex !== this.state.transitionFromIndex &&
|
||||
|
||||
Reference in New Issue
Block a user