Skip to content

Commit

Permalink
Fixed a bug with positioning of nested views inside <Text>
Browse files Browse the repository at this point in the history
Summary:
Fixing of recent regression in layout system.
Conseptually, a superview should define frames of child views.

Reviewed By: mmmulani

Differential Revision: D6980128

fbshipit-source-id: e267e966fd46af28db1d3d40939110040b74e33f
  • Loading branch information
shergin authored and facebook-github-bot committed Feb 14, 2018
1 parent 5f48bd8 commit 7d20de4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Libraries/Text/Text/RCTTextShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ - (void)layoutSubviewsWithContext:(RCTLayoutContext)layoutContext
maximumSize:frame.size
layoutDirection:self.layoutMetrics.layoutDirection
layoutContext:localLayoutContext];

// Reinforcing a proper frame origin for the Shadow View.
RCTLayoutMetrics localLayoutMetrics = shadowView.layoutMetrics;
localLayoutMetrics.frame.origin = frame.origin;
[shadowView layoutWithMetrics:localLayoutMetrics layoutContext:localLayoutContext];
}
];
}
Expand Down

0 comments on commit 7d20de4

Please sign in to comment.