I have a TextInput
which I have enabled multiline
as true. Thing is the Keyboard won\'t hide after Return is pressed. It goes to a new line. So I was h
Okay, found the solution.
this.setState({orderInstructions})}
keyboardType="default"
returnKeyType="done"
onKeyPress={this.handleKeyDown}
placeholder="Enter text here..."
/>
handleKeyDown: function(e) {
if(e.nativeEvent.key == "Enter"){
dismissKeyboard();
}
},
The method dismissKeyboard is from react-native-dismiss-keyboard.
This works perfectly for me.