'React Native Why does my keyboard dismiss instantly every time I tap on the textInput?
My keyboard always dismisses instantly when I tap on the textInput. This only happens on Android.
It's strange that I've tried removing all irrelevant codes to textInput only, but the problem still exists. This only happens to one page of my app.
<View>
<TextInput
style={{
paddingVertical: 0,
textAlignVertical: 'center',
height: height * 0.05,
width: width * 0.4,
fontSize: height * 0.027,
color: '#E1E1F2',
borderBottomWidth: 1,
borderBottomColor: '#6B778A',
justifyContent: 'center',
}}
placeholderTextColor={'#6B778A'}
underlineColorAndroid='black'/>
</View>
I think there is nothing wrong with the codes, I really need help.
screen record: media.giphy.com/media/Vc6AbKbMsnZX8ykKqR/giphy.gif
Solution 1:[1]
Probably your input is inside a ScrollView.
See React Native: Keyboard dismiss when changing focus in ScrollView for solution.
Solution 2:[2]
it happens due to the react native screens , navigation stack and native dependency versions , just update them to the latest versions
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Martin JaneÄek |
| Solution 2 | Abhishek Kumar Kushwaha |
