From b3cdf8cd7ecaf264f1eff2eae8050722d63ef15b Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 25 Feb 2021 17:54:49 -0800 Subject: [PATCH] Fix incorrect Height in Text components Summary: This diff fixes a bug in the calculation of layout for text components The rootcause of the bug is that fabric is not taking into consideration height constraints as part of the cache for text measurments. The title text was being measured with a specific height constraint (22px) at the begining of the render, later there was a re-measure for the same Text component with a different height constraint, but fabric was reusing the result of the first calculation instead of re-measuring the text. changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D26676716 fbshipit-source-id: 3e769e0ca35b3e363b96d3a6d1626a091eaad908 --- .../react/renderer/textlayoutmanager/TextMeasureCache.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h b/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h index d0e71872810d75..823d106a3191d8 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +++ b/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h @@ -190,7 +190,9 @@ inline bool operator==( lhs.attributedString, rhs.attributedString) && lhs.paragraphAttributes == rhs.paragraphAttributes && lhs.layoutConstraints.maximumSize.width == - rhs.layoutConstraints.maximumSize.width; + rhs.layoutConstraints.maximumSize.width && + lhs.layoutConstraints.maximumSize.height == + rhs.layoutConstraints.maximumSize.height; } inline bool operator!=(