From bda8aaeec204f355607693885a193d269846fe59 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Thu, 23 Apr 2020 15:36:20 -0700 Subject: [PATCH] Modal: disable view flattening explicitly for the children of Modal, the content wrappers Summary: I noticed that in ModalHostShadowNode.java (not used in Fabric), there's an assumption that the Modal will have exactly one child on the native side; this child is explicitly specified in Modal.js. However, in Fabric, these views are flattened and so the Modal will actually have N children - whatever children the product code passes into the Modal. In *theory* this should be fine, but might be causing issues. Not sure. This is an experiment and shouldn't be landed until we verify that (1) this actually matters, (2) that it fixes an issue with Modal on iOS or Android. Changelog: [Internal] Change to make Fabric consistent with non-Fabric Modal Reviewed By: mdvacca Differential Revision: D21191822 fbshipit-source-id: 9d65f346387fd056649d4063d70220f637ba8828 --- Libraries/Modal/Modal.js | 2 +- Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/Modal/Modal.js b/Libraries/Modal/Modal.js index ba842b17464..17885714dd0 100644 --- a/Libraries/Modal/Modal.js +++ b/Libraries/Modal/Modal.js @@ -237,7 +237,7 @@ class Modal extends React.Component { supportedOrientations={this.props.supportedOrientations} onOrientationChange={this.props.onOrientationChange}> - + {innerChildren} diff --git a/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap b/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap index 8c49d6f4aa0..807bc29ca55 100644 --- a/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap +++ b/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap @@ -23,6 +23,7 @@ exports[` should render as when not mocked 1`] = ` } >