Skip to content

Commit

Permalink
Update styles of Modal container as a pre-requisite to implement Moda…
Browse files Browse the repository at this point in the history
…l 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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Apr 30, 2019
1 parent 694bf71 commit ecdb239
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Libraries/Modal/Modal.js
Expand Up @@ -278,9 +278,9 @@ const styles = StyleSheet.create({
position: 'absolute',
},
container: {
position: 'absolute',
[side]: 0,
top: 0,
flex: 1,
},
});

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap
Expand Up @@ -26,8 +26,8 @@ exports[`<Modal /> should render as <RCTModalHostView> when not mocked 1`] = `
style={
Array [
Object {
"flex": 1,
"left": 0,
"position": "absolute",
"top": 0,
},
Object {
Expand Down

0 comments on commit ecdb239

Please sign in to comment.