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

Empty text content crashes the app on iOS #3

Closed jobpaardekooper closed 8 months ago

jobpaardekooper commented 8 months ago

If you have the following component on iOS it will crash:

<UITextView selectable uiTextView ></UITextView>

The following does work without any problems:

<UITextView selectable uiTextView >{ "" }</UITextView>

It might happen that there is some logic in your app where undefined ends up being inside the component and that will cause a crash. This does not happen on the normal react native Text component.

Here is the crash form inside xcode:

Thread 4: Swift runtime failure: Double value cannot be converted to Int because it is either infinite or NaN
Screenshot 2024-03-31 at 15 22 04

Seems like a division by zero issue to me.

haileyok commented 8 months ago

Merged in your fix, but still need to adjust for the "default" view height. Thanks for the report!