From 1fb24dc8a9487865e894ea91817a214d9f45ebe1 Mon Sep 17 00:00:00 2001 From: Oleksii Bulenok Date: Mon, 29 Jun 2026 17:08:16 +0200 Subject: [PATCH] fix post text not rendered --- package.json | 2 +- patches/react-native-uitextview@1.4.0.patch | 35 --------------------- pnpm-workspace.yaml | 1 - 3 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 patches/react-native-uitextview@1.4.0.patch diff --git a/package.json b/package.json index c46c9502c7..dff98faa59 100644 --- a/package.json +++ b/package.json @@ -237,7 +237,7 @@ "react-native-screens": "4.24.0", "react-native-scroll-forwarder": "link:./modules/react-native-scroll-forwarder", "react-native-svg": "15.12.1", - "react-native-uitextview": "^1.4.0", + "react-native-uitextview": "^2.2.0", "react-native-uuid": "^2.0.3", "react-native-view-shot": "^4.0.3", "react-native-web": "^0.21.0", diff --git a/patches/react-native-uitextview@1.4.0.patch b/patches/react-native-uitextview@1.4.0.patch deleted file mode 100644 index ea2a967cde..0000000000 --- a/patches/react-native-uitextview@1.4.0.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/ios/RNUITextViewShadow.swift b/ios/RNUITextViewShadow.swift -index c34ba712ca628ed8cf2db0f9fc332810ec86d34d..3602856dc8cd926b5321b4ecb109be9c00a23fe6 100644 ---- a/ios/RNUITextViewShadow.swift -+++ b/ios/RNUITextViewShadow.swift -@@ -159,13 +159,25 @@ class RNUITextViewShadow: RCTShadowView { - let maxSize = CGSize(width: CGFloat(maxWidth), height: CGFloat(MAXFLOAT)) - let textSize = self.attributedText.boundingRect(with: maxSize, options: .usesLineFragmentOrigin, context: nil) - -- var totalLines = self.lineHeight == 0.0 ? 0 : Int(ceil(textSize.height / self.lineHeight)) -- -- if self.numberOfLines != 0, totalLines > self.numberOfLines { -- totalLines = self.numberOfLines -+ var finalHeight: CGFloat -+ -+ if self.numberOfLines != 0 && self.lineHeight != 0.0 { -+ // numberOfLines is set with custom line height - need to calculate lines and snap to lineHeight multiples -+ // NOTE: this calculation can be inaccurate with fractional font sizes -+ var totalLines = Int(ceil(textSize.height / self.lineHeight)) -+ if totalLines > self.numberOfLines { -+ totalLines = self.numberOfLines -+ } -+ finalHeight = CGFloat(totalLines) * self.lineHeight -+ } else { -+ // Either no numberOfLines limit, or no custom lineHeight - use actual text height -+ // (numberOfLines without custom lineHeight is handled by the UITextView's textContainer.maximumNumberOfLines) -+ finalHeight = textSize.height - } - -- self.frameSize = CGSize(width: CGFloat(maxWidth), height: CGFloat(CGFloat(totalLines) * self.lineHeight)) -+ finalHeight = ceil(finalHeight) -+ -+ self.frameSize = CGSize(width: CGFloat(maxWidth), height: finalHeight) - return YGSize(width: Float(self.frameSize.width), height: Float(self.frameSize.height)) - } - diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 822c922ea6..b54dfa39c7 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -37,7 +37,6 @@ patchedDependencies: 'react-native-pager-view@6.8.0': patches/react-native-pager-view@6.8.0.patch 'react-native-reanimated@3.19.1': patches/react-native-reanimated@3.19.1.patch 'react-native-svg@15.12.1': patches/react-native-svg@15.12.1.patch - 'react-native-uitextview@1.4.0': patches/react-native-uitextview@1.4.0.patch 'react-native-view-shot@4.0.3': patches/react-native-view-shot@4.0.3.patch 'react-native@0.81.5': patches/react-native@0.81.5.patch 'sonner-native@0.21.0': patches/sonner-native@0.21.0.patch