From 41dd6fe6ea9755069e7a267d61e94fab9372007d Mon Sep 17 00:00:00 2001 From: Eric Vicenti Date: Thu, 30 Jul 2015 12:47:03 -0700 Subject: [PATCH] [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. --- Libraries/CustomComponents/Navigator/Navigator.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index dc9c99ca6..d8034d242 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/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 &&