Permalink
Browse files

[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.
  • Loading branch information...
ericvicenti committed Jul 30, 2015
1 parent f2b3057 commit 41dd6fe6ea9755069e7a267d61e94fab9372007d
Showing with 3 additions and 0 deletions.
  1. +3 −0 Libraries/CustomComponents/Navigator/Navigator.js
@@ -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 &&

0 comments on commit 41dd6fe

Please sign in to comment.