TextInput closes automatically when opened on android
See original GitHub issueDescription
Hi there,
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.
Version
0.64.0
Output of npx react-native info
System:
OS: macOS 11.4
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 29.16 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 16.5.0 - ~/.nvm/versions/node/v16.5.0/bin/node
Yarn: 1.22.15 - ~/.yarn/bin/yarn
npm: 7.19.1 - ~/.nvm/versions/node/v16.5.0/bin/npm
Watchman: 2021.06.07.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK:
API Levels: 29, 30, 31
Build Tools: 29.0.2, 29.0.3, 31.0.0
System Images: android-29 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7486908
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_292 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps to reproduce
Not really sure what could be the steps to reproduce. Maybe this issue starting happening a while ago but I just saw it now.
Snack, code example, screenshot, or link to a repository
Here is just an input centered inside a simple View. https://gfycat.com/ordinaryquestionabledinosaur
Issue Analytics
- State:
- Created 2 years ago
- Reactions:13
- Comments:29
Finally, made it work the issue I had was that I upgraded to 3.10.2 and not ~3.10.2. Give it a go. Hope this helps.
Hey all, asked the same thing on StackOverflow and the answer I accepted solved my issue. See if it fixes your problem too.
https://stackoverflow.com/questions/71227463/react-native-textinput-closes-automatically-when-opened-on-android