react-native-screens icon indicating copy to clipboard operation
react-native-screens copied to clipboard

Keyboard immediately closes on Android (react-native-screens: v3.13.1)

Open arron-olio opened this issue 2 years ago • 34 comments

Description

When upgrading from react-native-screens 3.10.1 to 3.13.1, the keyboard won't stay open. It will immediately close after opening and does not allow a user to type into a Text Input. We observed this behaviour on Android only.

Our fix was to downgrade back to react-native-screens 3.10.1

Steps To Reproduce

  1. Upgrade react-native-screens

Expected behavior

Keyboard opens and stays open after clicking on a text input

Actual behavior

Keyboard immediately closes after opening (after clicking on a TextInput)

Reproduction

We found the only way to reproduce this issue was to upgrade to 3.13.1

Platform

  • [ ] iOS
  • [X] Android
  • [ ] Web
  • [ ] Windows
  • [ ] tvOS
package version
react-native 0.64.2
@react-navigation/native 5.9.8
react-native-screens 3.10.1
react-native-safe-area-context 3.3.2
react-native-gesture-handler 1.10.3
react-native-reanimated 1.9.0

arron-olio avatar May 06 '22 08:05 arron-olio

We are still experiencing this and stuck on older versions #1342

shamilovtim avatar May 07 '22 06:05 shamilovtim

Can you provide a repository where it can be reproduced? It will make it simpler to debug it.

WoLewicki avatar May 10 '22 10:05 WoLewicki

use "react-native-screens": "^3.10.1", it working

Vantam1601 avatar May 18 '22 07:05 Vantam1601

This seems to happen when using react-navigation. If you create a simple stack with a screen with a text input, click on input the soft keyboard is immediately dismissed.

import { View, TextInput } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';

const TestStack = createStackNavigator();

function TestScreen() {
  return (
    <View style={{ padding: 16, flex: 1, backgroundColor: 'white' }}>
      <TextInput placeholder="Hello" />
    </View>
  );
}

function TestApp() {
  return (
    <NavigationContainer>
      <TestStack.Navigator>
        <TestStack.Screen name="test" component={TestScreen} />
      </TestStack.Navigator>
    </NavigationContainer>
  );
}

janicduplessis avatar May 25 '22 23:05 janicduplessis

Interesting. For me this issue only happens when I have autoFocus set. It will open the keyboard and closes it immediately. But tapping on it works for me, at least in my setup. (native-stack).

Looks like downgrading to 3.11 does circumvent the issues for now.

hirbod avatar May 27 '22 09:05 hirbod

Same issue here. Looks like the issue is reproducible only with old Android devices.

alessioemireni avatar Jun 01 '22 13:06 alessioemireni

Same issue here. It also has been noted in numerous other forums:

  • https://stackoverflow.com/questions/71227463/react-native-textinput-closes-automatically-when-opened-on-android
  • https://github.com/facebook/react-native/issues/33164

KrisLau avatar Jun 01 '22 16:06 KrisLau

We had this issue as well. Rolling back to 3.11.1 resolved the issue for us. 3.12.0 seemed to be the version that introduced this issue.

mzpeartx avatar Jun 08 '22 17:06 mzpeartx

I can also confirm that 3.11.1 works without this issue but 3.12.0 does not.

levani avatar Jul 15 '22 11:07 levani

3.15.0 has the same issue

Andriiklymiuk avatar Jul 18 '22 19:07 Andriiklymiuk

I upgraded to SDK 46 (dev client) today and I can confirm that my inputs are closing now. Not always, but a lot of times.

https://user-images.githubusercontent.com/504909/184336331-8c64f3a2-a41f-4184-9702-544cb18b37e2.mov

hirbod avatar Aug 12 '22 10:08 hirbod