Home > Software design >  React Native TextInput closes automatically when opened on android
React Native TextInput closes automatically when opened on android

Time:02-24

I switched laptops and cloned the repository of my project, did a quick yarn install and looks like it was a big difference from the one on the main branch but I didn't bother since maybe it's just because of different Node versions.

Now every time I click on one TextInput the keyboard opens and closes immediately only on android. I attached a quick recording here. Tried some solutions and it looks like switching android:windowSoftInputMode from adjustResize to adjustPan in AndroidManifest.xml fixes the problem with the closing but I'm not really happy with the behaviour of the keyboard in the app when it's set to adjustPan. Maybe this issue starting happening a while ago but I just saw it now.

Here is just an input centered inside a simple View. https://gfycat.com/ordinaryquestionabledinosaur

Any suggestions anyone?

CodePudding user response:

Was facing a similar issue, turned out that the react-native-screens library was causing the problem. Try setting the version to "~3.10.2". Worked out for me.

  • Related