Reputation: 275
I want to have a TextInput with react native to wrap to the next line once the text goes over the line. I read the docs and I saw the multiline prop. The problem with multiline set to true is that when you hit return key it goes to a new line.
Is there a way that you can have a multiline TextInput with react native with the return to new line disabled?
Upvotes: 0
Views: 604
Reputation: 362
Try this:
<TextInput
value={}
onChangeText={}
returnKeyType= "send" or "done" //depending on what you want to do.
multiline
/>
Or just put the returnKeyType="" and look at the suggestions to choose your desired action.
Upvotes: 0
Reputation: 101
You could try this:
<TextInput
multiline={true}
value={this.state.fieldValue}
onChangeText={(text) => { this.setState({ fieldValue: text.replace('\n', '') }) }} />
Upvotes: 1