Skip to content

Commit bda8aae

Browse files
JoshuaGrossfacebook-github-bot
authored andcommitted
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
1 parent 17adf54 commit bda8aae

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Libraries/Modal/Modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class Modal extends React.Component<Props> {
237237
supportedOrientations={this.props.supportedOrientations}
238238
onOrientationChange={this.props.onOrientationChange}>
239239
<ScrollView.Context.Provider value={null}>
240-
<View style={[styles.container, containerStyles]}>
240+
<View style={[styles.container, containerStyles]} collapsable={false}>
241241
{innerChildren}
242242
</View>
243243
</ScrollView.Context.Provider>

Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ exports[`<Modal /> should render as <RCTModalHostView> when not mocked 1`] = `
2323
}
2424
>
2525
<View
26+
collapsable={false}
2627
style={
2728
Array [
2829
Object {

0 commit comments

Comments
 (0)