react-native keyboard auto hide issue

Viewed 2054

Currently, I am developing a react-native app. The problem is, when I touched text input box, the keyboard automatically hiding for first time only for every time relaunched my app.

My TextInput Component here:

<TextInput
  blurOnSubmit={false}
  placeholder={"Email..."}
  autoCapitalize="none"
  style={{
    height: 40,
    paddingLeft: 10,
    fontSize: 18,
    fontWeight: "bold",
    width: "90%",
  }}
  onChangeText={(email) => {
    this.setState({ email });
    this.validateEmail(email).then((res) => this.handleResponse(res));
  }}
  value={this.state.email}
  ref={(ref) => (this.email = ref)}
  onSubmitEditing={() => this.mobile.focus()}
/>

My Package.json dependencies

  "dependencies": {
    "@react-native-community/async-storage": "^1.11.0",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/bottom-tabs": "^5.5.2",
    "@react-navigation/drawer": "^5.8.2",
    "@react-navigation/native": "^5.5.1",
    "@react-navigation/stack": "^5.5.1",
    "react": "16.11.0",
    "react-native": "0.62.2",
    "react-native-datepicker": "^1.7.2",
    "react-native-gesture-handler": "^1.6.1",
    "react-native-looped-carousel": "^0.1.13",
    "react-native-reanimated": "^1.9.0",
    "react-native-safe-area-context": "^3.0.5",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-screens": "^2.8.0",
    "react-native-vector-icons": "^6.6.0"
  },
2 Answers

Opps, Unfortunately the React Native teams recently released new version of RN 0.63.0. I migrated my project from version 0.62.2 to 0.63.0. Then this issue gone. So happy.
Thanks for RN developers for new release...

You can modify you AndroidManifes.xml like this below, this bugs is comes up within React Native above >59.

  <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:screenOrientation="portrait"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize"
        >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

Then save, and run again your application project.

Related