-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[iOS][KeyboardAvoidingView] Using KeyboardAvoidingView inside a ScrollView causes the app the crash when focusing an input #42939
Comments
@lunaleaps I can reproduce this issue using the reproducer mentioned in the description https://github.com/slauzinho/KeyboardAvoidingViewExample. |
@cortinico same issue. Moving KeyboardAvoidingView over a ScrollView fixed my problem with crashing application when clicking on an input (IOS) The crash was happening when publishing the app and on real device. Guideline 2.1 - Performance - App Completeness We discovered one or more bugs in your app. Specifically, login screen was unresponsive. Please review the details below and complete the next steps. Review device details:
|
Kindly check this key in scrollview |
|
That's true. Setting overScrollMode didn't help. |
i dont think its crash, its loop cause mis-use of element. in this case keyboardawarescroll in scrollview; when keyboard is open its trigger to keyboardawarescroll to extend bottom height and put keyboard down and thats circle trigger to scrollview because layout change and also scrollview extends layout and keyboardawarescroll again try to put keyboard to bottom so extend layout and again triggered scrollview. Even i prevent this loop keyboardawarescroll its not working properly, can't arrange keyboard position and content because scrollview. Related part KeyboardAvoidingView.js:
|
Any updates? Also experiencing this - v0.73.4 |
Experiencing the same issue here! RN v0.73.4 as well. The issue indeed seems to be related to being inside a When setting the behaviour to Edit: added more details |
I tried @Navaie's solution. |
Like @kokosky93 , my workaround was to swap the component order to make the So far, everything seems to be working as intended. I also observed that this issue only affected distributions running on real iOS devices. Not reproducible in either ExpoGo or Android builds. |
Thanks buddy! Works! Yes, must change behavior to ="position", else will not scroll. |
We were running into this as well and have temporarily removed the |
Thanks |
Experienced the same thing, I had "react-native": "0.73.6" |
Experiencing the same thing here as well. 0.73.6 |
Any updates in regards to this issue? |
I'm facing this same issue too, using It only freezes on a real iOS device (not all iOS devices either, so far I've been able to reproduce this issue on iPhone SE running latest iOS) - but unable reproduce on simulator/android. Update: Flipping the sequence so that SafeAreaView is encapsulated by KeyboardAvoidingView seems to resolve it - confirmed after testing. "react-native": "0.73.7" |
@shahidrogers If the issue happens solely because of the |
Still happens with react native |
I think I’m experiencing something similar with TextInput inside of a KeyboardAvoidingView on react native 0.74.1. |
Same here.. 0.74.1 |
Same issue here. Problem seems to appear only on "small" device: working perfectly on iPhone 11, crashing on iPhone 13 mini. I'm currently trying to implement this PR in local before it get merged: |
tried this change locally, seems not working for me. v0.73.8 |
Glad this is being fixed. Its super frustrating because it only appears when uploaded to test flight. I couldn't reproduce the error in my development build. |
I think I'm facing the same issue with an iPad (10th gen) and an iPhone 11 so not only small devices. Besides, I have an iPhone 15 that doesn't encounter this bug. Edit: my problem might not be completely related to this so don't rely too much on it but while I was fixing my issue i discovered that I had packed ScrollView into ScrollView (nestedScrollEnabled={false}) into KeyboardAvoidingView into ScrollView into KeyboardAvoidingView. I did fix this disaster to have only ScrollV into KeyboardAV, but I noticed somewhere else where it remains a SV into KAV into SV into KAV and it doesn't bug/freeze so ¯\_(ツ)_/¯ |
I have the same problem in iOS with RN .73.9. |
remove KeyboardAvoidingView |
Hey guys, anyone knows alternative to KeyboardAvoidingView? |
move |
I found a simple example where I can reproduce a similar issue on the Android emulator. I'm not sure, but I believe the problem is related. The issue occurs when the position of the KeyboardAvoidingView is above the size of the keyboard. This causes the KeyboardAvoidingView component to keep increasing the padding indefinitely.
|
We've encountered this issue on some real iOS devices, despite using both To address this, I'm planning to switch to Keyboard Controller and replace It's challenging to debug since I haven't been able to reproduce the issue on my end. @cipolleschi, could you assist with this? It feels like a regression that's been around in RN for a while. Environment:
|
Removing |
Hi guys I have the same problem with rn 0.73.9 on iOS real device in production and scheme build config:Release on simulator. It worried me but solved. <ScrollView>
<KeyboardAvoidingView behavior={Platform.OS == "ios" ? "paddding":null}>
...
</KeyboardAvoidingView>
</ScrollView> If KeyboardAvoidingView inside the ScrollView with prop behavior="padding" in iOS,screen is freezes. Using it belows everything worked for me. <KeyboardAvoidingView behavior={Platform.OS == "ios" ? "paddding":null}>
<ScrollView>
...
</ScrollView>
</KeyboardAvoidingView> Some said above that it was caused by SafeAreaView. My SafeAreaView defined in App.js. In my project, it's not because of it. I hope it'll fixed. |
Hello there, I'm sorry that you are encountering this issue. At the moment we are hyper focused on rolling out the New Architecture, so issues for the Old Architecture only has lower priority as they will move capacity away from our final goal. |
@cipolleschi We're seeing this issue too across old and new devices; we've just upgraded to Similar to #42939 (comment), we're getting it on |
I'm looking into this, and I see that the app get blocked and eventually crashes. To unblock on this, I actually think that you should not use the |
me too, you can move it. it works |
@cipolleschi How did you reproduce it? |
@matinzd with the reproducer attached to the issue: |
Been debugging an issue with our app freezing on certain screens only in real iOS 17.5+ devices, and finally narrowed it down to this same issue here that people have been reporting. Some details:
@cipolleschi while I understand the prioritization of the new architecture right now, I'd argue that there are probably a good number of teams and products still using older versions of RN. Even for those of us who are on the newer versions where we can opt into the new architecture, there are a lot of third party packages and dependencies that don't support the new architecture yet, which leaves us in a tough spot because "just upgrade to the new architecture" is not a solution. (And as a few others have also reported, it's not just a ScrollView / SafeArea issue) |
Description
When
KeyboardAvoidingView
inside aScrollView
and focus aTextInput
the app crashes (goes extremely slow).This seems to only happen if the
KeyboardAvoidingView
needs to trigger the animation, if the ScrollView is small it works fine.Testing with react native
0.72.9
the issue doesn't seem to happenSteps to reproduce
yarn ios
React Native Version
0.73.4
Affected Platforms
Runtime - iOS
Output of
npx react-native info
The text was updated successfully, but these errors were encountered: