-
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
KeyboardAvoidingView with behavior="height" doesn't resize back on keyboard close #13754
Comments
This same question was asked on Stack Overflow Edit: When I originally posted there was no answer, but now there is 🎉 |
I'm seeing this in React Native version: 0.40.0 |
Issue is still there in React Native For those running into this issue you can find a work-around here https://gist.github.com/steven89/f7aedca683deee6ee8211399e94cd583 The issue is related to
The work-around I have found to make it work is to fixate the layout height to its initial value before render (componentWillUpdate). A real fix would be to find a way to call onLayout when keyboard is dismissed and before rendering. If you want to take a look, the KeyboardAvoidingView's code is there: |
Having the same issue here. |
+1 Same issue: keyboardVerticalOffset not fully removed. v0.45.0 |
A work-around for this issue is doing this https://shift.infinite.red/avoiding-the-keyboard-in-react-native-56d05b9a1e81 |
I had similar problem. KeyboardAwareScrollView solved the problem for me. |
Same issue here, iOS 11, react native 0.50. Using |
Same issue here. React Native 0.50.4. |
And here I was messing with |
Could it be related to the |
We also exhibited this problem, with React Native 0.52.x Using |
Yes along with |
|
still a problem on android react: 16.2.0 => 16.2.0 |
I've created Android and iOS specific implementations for this and the result is that on both platforms the height is restored properly when the keyboard is dismissed. See this gist here: https://gist.github.com/markoudev/c3f06afc5d88d1056859ecc01c2777bc (it's in TypeScript, but you'll get the gist (heh) of it). Note that you have to set |
|
Here is a workaround to fix the leftover space issue after the keyboard is dismissed: https://stackoverflow.com/q/41616457/193210 @Lily418 mentioned this in a comment above, but there wasn't an answer at the time. |
Summary: Closes facebook#13754 Fixing previously reported bug facebook#13754 Video here https://imgur.com/a/3IgqP [GENERAL] [BUGFIX] [KeyboardAvoidingView] - Correct height behaviour when keyboard closed Pull Request resolved: facebook#16965 Differential Revision: D13860208 Pulled By: cpojer fbshipit-source-id: 9ae7f81fd24999518a6ae85016d4f75dac3c4274
@afilp try to put your |
…lose (#18889) Summary: <!-- Required: Write your motivation here. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. --> Fixes #13754 Pull Request resolved: #18889 Differential Revision: D14486115 Pulled By: PeteTheHeat fbshipit-source-id: 7b8b4fa9d2c99fc5d6145fed4681afdc4bb14fb8
…lose (#18889) Summary: <!-- Required: Write your motivation here. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. --> Fixes #13754 Pull Request resolved: #18889 Differential Revision: D14486115 Pulled By: PeteTheHeat fbshipit-source-id: 7b8b4fa9d2c99fc5d6145fed4681afdc4bb14fb8
Description
When using the KeyboardAvoidingView with behavior set to height it works correctly the first time you open the keyboard, but after keyboard is dismissed it doesn't return to it's original position.
Recreation:
https://snack.expo.io/rJYAymwy-
The code below can be used to recreate this problem:
Additional Information
The text was updated successfully, but these errors were encountered: