Open enestatli opened 1 month ago
Hello @enestatli @cortinico I hope you're all doing well. I've been looking into this issue and came across similar cases referenced in issues #9077 and #19453. There is also a related Stack Overflow question that you can find here.
It appears that the root cause is related to the height of contentSize
of a UITextView
. When showing a very long text and this height reaches a very large value, such as 63863
(for my reproduce) or larger, the text does not display properly within the TextView
, even though the previous 8192
limit in previous issues seems to have been removed. It seems like Apple has increased the rendering limit of the UITextView
's content, but there is still a limit to the specific size.
Additionally, I have found that when you continuously add content to a UITextField
that initially displays text correctly, the text continues to display properly even as the contentSize
gradually exceeds a certain limit. In my tests, the contentSize
has surpassed 130000
without any issues. All of these tests were conducted on iOS 17.
A potential solution is mentioned here, which might still be functional. However, I do not recommend this approach as it complicates the code, making it harder to maintain and more fragile during framework upgrades. I'm still actively working on finding a more elegant solution.
In the meantime, I suggest updating the documentation of the TextInput
component to inform developers about this issue.
Description
When using a TextInput component with a large fontSize (greater than 40), the text becomes invisible on iOS devices. This issue does not occur on Android, where the text is displayed correctly regardless of the font size. The problem is particularly evident when the text is long and the TextInput is set to multiline.
Steps to reproduce
React Native Version
0.74.5
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/@enestatli65/quiet-orange-strawberries
Screenshots and Videos
No response