Pang
Pang

Reputation: 101

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

Upvotes: 9

Views: 5810

Answers (2)

it happens due to the react native screens , navigation stack and native dependency versions , just update them to the latest versions

Upvotes: 3

Martin Janeček
Martin Janeček

Reputation: 585

Probably your input is inside a ScrollView.

See React Native: Keyboard dismiss when changing focus in ScrollView for solution.

Upvotes: 1

Related Questions