-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard immediately closes on Android (react-native-screens: v3.13.1) #1447
Comments
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", |
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 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: |
We had this issue as well. Rolling back to |
I can also confirm that |
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. IMG_0363.mov |
3.19.0 has the same issue |
3.20 has the same issue |
3.18.2 has the same issue. Is it gonna get fixed? there are heaps of people using this library. |
3.25.0 still experiencing this issue. |
I was facing the same Issue, following steps fixed the issue :
|
Following first two steps resolved issue for me. |
any updates? |
Ok I found, not sure if its the same issue as you guys but here is my fix : what cause the bug for me is that when I update the state re-render so the keyboard disappear and the field reset. So the key is just to keep the outside of the component, ex : (before) 👎
(after) 👍
MyFormComponent.js
Edit : ignore my answer, it was actually coming from @shopify/restyle component , when is inside it it always re-render :/ |
3.27.0 still experiencing this issue. |
same here |
This started happening for me as well, upgraded our app to Expo 50 and updated various packages with it. Pretty tricky to track down.. |
Had a few of our customers experience this too. We are on 3.29.0 @kkafar I see you assigned yourself this one, are you able to provide an update and any guidance? |
Yes I also used the 3.29.0 still facing the issue |
Still happening with 3.30.1. Looks like the problem occurs when the text input position is inside the area where the keyboard pops up. If the text input is above the keyboard area everything is fine. |
In my case, the test input was inside top tab, not in the keyboard showing area still facing this issue. |
Still reproduced on 3.31.1, Expo 50. |
@cosminpwd same here me too. If TextInput component is at the position where being hide by keyboard, keyboard is dismissed right after opened. But if TextInput component's position is far from bottom and not being hide by keyboard, keybaord works normally. |
Same issue here,
I was using it inside a ScrollView, removing it solved the issue to me |
This is true in my case. |
I'm experiencing the same issue with react-native-screens version 3.30.1. I changed my navigation from Drawer to a combination of Drawer and Stack, and now when I tap on a TextInput, the keyboard appears but disappears after typing a couple of letters. Whatever was supposed to be saved in onChangeText also gets erased because the TextInput reverts back to displaying the placeholder value. Another issue I'm encountering is that within the same screen, when I change the value of a useState(), it doesn't seem to take effect. For example, when selecting a color from a list, the list remains visible whereas previously, before changing the navigation type, the list would disappear and only the selected color would show up. Any help would be greatly appreciated! |
Happy 2 years anniversary, issue 1447! 🎉 |
I was experiencing this issue within a <KeyboardAvoidingView behavior={Platform.OS === 'android' ? undefined : 'padding'} /> Kudos to @brianlenz for figuring this out! |
@levymetal can confirm this fix worked for me as well, thanks Although I used {Platform.OS === 'android' ? 'height' : 'padding'} My code for anyone who might come across this in the future <KeyboardAvoidingView
behavior={Platform.OS === 'android' ? 'height' : 'padding'}
>
<TouchableWithoutFeedback onPress={() => Keyboard.dismiss()}>
<ScrollView
keyboardShouldPersistTaps="always"
>
{...rest of the code}
</ScrollView>
</TouchableWithoutFeedback>
</KeyboardAvoidingView> |
Description
When upgrading from
react-native-screens
3.10.1
to3.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
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
The text was updated successfully, but these errors were encountered: