Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show keyboard done button in multiline text in React Native

I'm having a multiline text in my react native view. When user types , in keyboard view I need to show done (tick mark) button. Instead of that it shows next line icon. Is there any way to achieve this. If I use text input I can do that , but I need multiple lines to be added. This is my text input

<TextInput style = {styles.contactInput}
           underlineColorAndroid="transparent"
           multiline = {true}
           placeholder="Type your feedback here"/>
like image 474
venura Avatar asked Feb 20 '18 18:02

venura


People also ask

How do you dismiss the keyboard in a multiline TextInput react native?

TextInput has a blurOnSubmit prop; when set to true, the return key dismisses the keyboard. For Multiline TextInput, return key enters a new line and not dismiss the keyboard. So, clicking on some other part of the View should dismiss the keyboard.

How do I use onSubmitEditing react native?

onSubmitEditing is triggered when you click the text input submit button (keyboard button). onChangeText is triggered when you type any symbol in the text input. In your example, you will achieve what you need in both cases.

How do I change text input value in react native?

TextInput needs value that it is the value that is gonna be shown inside the TextInput. And to update that value you use onChangeText that is gonna call whatever function you specify every time the text into the TextInput change.


1 Answers

You can add blurOnSubmit={true} in order to show the submit button rather than the return key

<TextInput style = {styles.contactInput}
           underlineColorAndroid="transparent"
           multiline = {true}
           blurOnSubmit={true}
           placeholder="Type your feedback here"/>
like image 138
Lloyd Rajoo Avatar answered Oct 05 '22 18:10

Lloyd Rajoo