2

I am using multiline text input with placeholder like this.
I am using onContentSizeChange to change the height of TextInput.

 <TextInput
 placeholder='abcd'
 placeholderTextColor='gray'
 multiline={true}
 onContentSizeChange={(e) => console.log(e.nativeEvent.contentSize)}
 value=''
 style={{width:'100%'}}
 />

Because of this placeholder, the onContentSizeChange is returning wrong heights for the textInput.

It works perfectly in android but messed up in iOS.

It assumes that the text input width is equal to placeholder length, so onContentSizeChange returns increased height when the text length becomes greater than the placeholder length

Arpit Gupta
  • 65
  • 1
  • 9

0 Answers0