Dismiss keyboard in multiline TextInput in React native

TextInput has a blurOnSubmit prop; when set to true, the return key dismisses the keyboard.

However currently the prop does not work on Android. I've posted an issue on the subject: https://github.com/facebook/react-native/issues/8778


Hope it helps other , as wasted time on reading many github threads and issues..

By doing below code , you keyboard show return key you wanted for example "done", "go" and also dismiss the keyboard when you press return key in my case done key while using multi line seamlessly.

import {Textinput, ScrollView, Keyboard} from 'react-native';

// ...code 

 <TextInput
     keyboardType="default"
     returnKeyType="done"
     multiline={true}
     blurOnSubmit={true}
     onSubmitEditing={()=>{Keyboard.dismiss()}}
  />

Tags:

React Native