From ecdb239eaa01978f86bfd3d37be63ef8b1be0080 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 30 Apr 2019 15:01:37 -0700 Subject: [PATCH] Update styles of Modal container as a pre-requisite to implement Modal on Fabric Summary: This diff changes the style of the Modal container style as a pre-requisite to implement Modal on Fabric. In the current version of React Native the size of the View container is determined at runtime using the size of the screen. The size of this view is set overriding the Widht and Height of this Container View (using the screen size), in Fabric we can not update the size of that view, instead we set the size of the RCTModalHostView to take the size of the whole screen. Since the RCTModalHostView has an absolute position and it has the size of the screen, making this change should be enough to keep backward compatibility and be able to implement Modal on Fabric Reviewed By: JoshuaGross Differential Revision: D15067616 fbshipit-source-id: d7302ef3afc503adfee10e12fb6d0ebd371fb7ed --- Libraries/Modal/Modal.js | 2 +- Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Modal/Modal.js b/Libraries/Modal/Modal.js index 08a5d74ea85..592383a91ee 100644 --- a/Libraries/Modal/Modal.js +++ b/Libraries/Modal/Modal.js @@ -278,9 +278,9 @@ const styles = StyleSheet.create({ position: 'absolute', }, container: { - position: 'absolute', [side]: 0, top: 0, + flex: 1, }, }); diff --git a/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap b/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap index 8aa3579e006..8c49d6f4aa0 100644 --- a/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap +++ b/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap @@ -26,8 +26,8 @@ exports[` should render as when not mocked 1`] = ` style={ Array [ Object { + "flex": 1, "left": 0, - "position": "absolute", "top": 0, }, Object {