I have TextInput
that receives onChangeText
as a prop:
<TextInput
...
value={this.state.myString}
onChangeText={this.updateInput.bind(this)}
/>
And updateInput
is represented as:
updateInput(newString) {
this.setState({ myString: newString.trim() });
}
This works for Android only. Is there some way to trim user input on both platforms (iOS, Android)?
Update
Actually, string is processed as trimmed, but you can still type as many whitespaces as you want on iOS. And if you type two whitespaces in a row the dot appears like it would be the end of the sentence. This is undesirable behaviour, is there a way to avoid it?
Link with example video: https://streamable.com/dzl3c