bluesky-social / react-native-uitextview

A UITextView implementation for React Native that allows for full text highlighting/selection, native translations, etc.
MIT License
251 stars 15 forks source link

Long text creates margin at the bottom of the text #6

Open jobpaardekooper opened 7 months ago

jobpaardekooper commented 7 months ago

When you have a large amount of text inside the component you will eventually get some margin at the bottom of the text view. The longer you make the text the more margin will be there. The margin seems to get added in increments of the line height as you make the text longer.

If you take 30 paragraphs of Lorem Ipsum you will see one extra line:

Screenshot 2024-04-05 at 11 06 43

The red background is set on the UITextView.

If you add another 30 paragraphs you will get another extra empty line:

Screenshot 2024-04-05 at 11 07 45

My guess is that it would have to do with some small error in the view height calculation that adds up over time as the size of the text grows. But I have not looked at the code much so I don't know exactly.

haileyok commented 7 months ago

Nice find. Are you adding any styles outside of the background color here to the text? Will take a look sometime this weekend.

jobpaardekooper commented 7 months ago

No styles at all originally. I found it because the container it was in had some random extra space at the bottom. The red background was just to clearly demonstrate the extra space.

Thanks for taking a look!