I have a very simple TextInput
component on a screen like and an onEndEditing
method like so:
<TextInput
style={Styles.input}
placeholder='testing placeholder'
placeholderTextColor={Colors.gray}
onEndEditing={this.onEndEditing}
selectionColor={Colors.darkCursor}>
</TextInput>
onEndEditing = async (event): Promise<void> => {
console.log('in update');
};
It is inside of a FlatList
which is wrapped in a KeyboardAvoidingView
.
On Android, when the TextInput
is tapped on and focused, if the onscreen keyboard pops up and overlaps the input, the input will lose focus and must be tapped on again. However, if the keyboard DOES NOT overlap the input, the input will keep its original focus. This does not happen on iOS.
I'm noticing that the onEndEditing
method is called when the input loses focus from the keyboard overlap.
Update: Wrapping the FlatList
in a ScrollView
fixes it for whatever reason, but obviously that is not a good solution.