react-native-screens
react-native-screens copied to clipboard
Keyboard immediately closes on Android (react-native-screens: v3.13.1)
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
- 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 |
We are still experiencing this and stuck on older versions #1342
Can you provide a repository where it can be reproduced? It will make it simpler to debug it.
use "react-native-screens": "^3.10.1", it working
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>
);
}
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.
Same issue here. Looks like the issue is reproducible only with old Android devices.
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
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.
I can also confirm that 3.11.1
works without this issue but 3.12.0
does not.
3.15.0 has the same issue
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