React Native Why does my keyboard dismiss instantly every time I tap on the textInput?
Asked Answered
G

2

9

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

Granophyre answered 20/9, 2019 at 11:17 Comment(10)
can you please provide all your codeKamacite
Can you please provide the entire code, perhaps the entire render function? I believe there is a lot more than what you're showing here.Nucleoprotein
please add onChangeText event and value in your textinput.Kamacite
@Nagesh It doesn't work, I've tried it.Granophyre
@swonder that's all the code. Here is the screen record media.giphy.com/media/Vc6AbKbMsnZX8ykKqR/giphy.gifGranophyre
@pang please update your latest code with onChangeText eventKamacite
@pang Please provide all code. There is something more than just a view and an input. That's for sure. Let us help you, post your code.Nucleoprotein
@Nagesh I did, but it doesn't work.Granophyre
@swonder It's true, that's all the elements in the script.Granophyre
did you fix this issue?Husky
P
3

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

Paring answered 13/5, 2022 at 5:53 Comment(0)
B
1

Probably your input is inside a ScrollView.

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

Bathilda answered 20/9, 2019 at 11:21 Comment(1)
It's only wrapped by a View.Granophyre

© 2022 - 2024 — McMap. All rights reserved.