From 7c75ece29da3a542dd89710ee4f0eca92a503b86 Mon Sep 17 00:00:00 2001 From: Oleksii Bulenok Date: Thu, 2 Jul 2026 11:49:44 +0200 Subject: [PATCH] fix (hopefully) the issue with text overflowing instead of wrapping --- patches/react-native@0.81.5.patch | 17 +++++++++++++++++ patches/react-native@0.81.5.patch.md | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/patches/react-native@0.81.5.patch b/patches/react-native@0.81.5.patch index a71008d2d1..4a04d61383 100644 --- a/patches/react-native@0.81.5.patch +++ b/patches/react-native@0.81.5.patch @@ -150,6 +150,23 @@ index 8b6571698fc5dd091a0d8980a33bb40295faf305..27c97bfeb6f13907c89f1d85f2bb8b8a reactChoreographer.postFrameCallback(ReactChoreographer.CallbackType.IDLE_EVENT, this) } } +diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +index 216bb23beb023ef6c3ae814c17e05bccbda7fc91..6ad5cc1d9ed5b8cd2df08ad77adca56c6bb58ff4 100644 +--- a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm ++++ b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +@@ -386,9 +386,10 @@ - (TextMeasurement)_measureTextStorage:(NSTextStorage *)textStorage + size.height = enumeratedLinesHeight; + } + ++ CGFloat epsilon = 0.001; + size = (CGSize){ +- ceil(size.width * layoutContext.pointScaleFactor) / layoutContext.pointScaleFactor, +- ceil(size.height * layoutContext.pointScaleFactor) / layoutContext.pointScaleFactor}; ++ ceil((size.width + epsilon) * layoutContext.pointScaleFactor) / layoutContext.pointScaleFactor, ++ ceil((size.height + epsilon) * layoutContext.pointScaleFactor) / layoutContext.pointScaleFactor}; + + __block auto attachments = TextMeasurement::Attachments{}; + diff --git a/third-party-podspecs/fmt.podspec b/third-party-podspecs/fmt.podspec index 2f38990e226c13f483aaf1b986302d4094243814..9b02e481e290299be20a6f09c42056ff51695e9b 100644 --- a/third-party-podspecs/fmt.podspec diff --git a/patches/react-native@0.81.5.patch.md b/patches/react-native@0.81.5.patch.md index 9c93aee5cb..7b44346c23 100644 --- a/patches/react-native@0.81.5.patch.md +++ b/patches/react-native@0.81.5.patch.md @@ -11,3 +11,8 @@ in the RN repo: https://github.com/facebook/react-native/issues/43388 Patching `RCTRefreshControl.m` and `RCTRefreshControl.h` to add a new `forwarderBeginRefreshing` method to the class. This method is used by `ExpoScrollForwarder` to initiate a refresh of the underlying `UIScrollView` from inside that module. + +## RCTTextLayoutManager.mm Patch - Text overflows instead of wrapping on the last line + +Issue: https://github.com/react/react-native/issues/53450#issuecomment-3298157830 +Bandaid fix taken from: https://github.com/react/react-native/commit/581d643a9e59fd88f93757f80194e1efd11bd0e5