From c888af631079ed6f3f24004f44c97383dfaa30af Mon Sep 17 00:00:00 2001 From: Alexander Brokking Date: Mon, 13 Jul 2026 18:12:50 +0200 Subject: [PATCH] fix(ios): prevent wrapped text clipping --- .../renderer/textlayoutmanager/RCTTextLayoutManager.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm index 1dfb60edb9b..461c80273f1 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm @@ -581,8 +581,11 @@ - (TextMeasurement)_measureTextStorage:(NSTextStorage *)textStorage size.height = enumeratedLinesHeight; } - size = (CGSize){ceil(size.width * layoutContext.pointScaleFactor) / layoutContext.pointScaleFactor, - ceil(size.height * layoutContext.pointScaleFactor) / layoutContext.pointScaleFactor}; + // Wrapped text needs one extra physical pixel so its final line remains visible after layout rounding. + CGFloat additionalHeightInPixels = textDidWrap ? 1.0 : 0.0; + size = (CGSize){ + ceil(size.width * layoutContext.pointScaleFactor) / layoutContext.pointScaleFactor, + (ceil(size.height * layoutContext.pointScaleFactor) + additionalHeightInPixels) / layoutContext.pointScaleFactor}; NSRange visibleGlyphRange = [layoutManager glyphRangeForTextContainer:textContainer];