wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.04k stars 2.67k forks source link

[Android] Going back with open keyboard, half screen #7582

Open Ainias opened 2 years ago

Ainias commented 2 years ago

πŸ› Bug Report

When going back from a screen with an open keyboard, the screen is not resized to full screen. This only affects android devices and emulators with API 29 and below.

Have you read the Contributing Guidelines on issues?

yes

To Reproduce

  1. Open Screen with input element
  2. Open input (keyboard)
  3. use back-button in top bar
  4. Screen is only half used

I'm not sure what else the "requirements" for this bug are. I've tried to reproduce it with the playground-app and used a full day to get it working, but the bug never showed inside the playground app.

Expected behavior

The components should fill the whole screen

Actual Behavior

the reserved space for the keyboard is reserved, even though the keyboard is closed

https://user-images.githubusercontent.com/17934715/185083564-a5d4ead1-b828-472f-9436-879db2219c56.mp4

Your Environment

Reproducible Demo

EDIT: I've got a reproducible repo. I've created a new project with npx react-native init rnnKeyboardBug --version 0.67.4. With this it is possible to reproduce the Bug when changing the android:windowSoftInputMode to stateAlwaysHidden|adjustPan. No idea why this is not the case for the playground-app. Here is the repo:
https://github.com/churchtools/rnnKeyboardBug

ORIGINAL: I've tried to reproduce it inside the playground app, but the bug did not show itself. I've changed the manifest, the gradle-files and the sourcecode to mirror the ones in my active project, but without success.

Are you willing to resolve this issue by submitting a Pull Request?

agestaun commented 2 years ago

Same problem

thanksyouall commented 2 years ago

Similar issue https://github.com/wix/react-native-navigation/issues/7569

kabus202 commented 2 years ago

any workaround?

Ainias commented 2 years ago

@kabus202 the only "workaround" is to downgrade to version 7.23.1. This version is not compatible with react native 69.1, which makes this bug the only reason why we are not upgrading our react native version.

Ainias commented 2 years ago

I've got a Reproducible Demo with the react native starter: https://github.com/churchtools/rnnKeyboardBug

@kabus202 I think a workaround is to not use stateAlwaysHidden|adjustPan for android:windowSoftInputMode, but I did not test it yet

djschilling commented 1 year ago

Can someone have a look at the reproducible Demo? Would be appreciated if this bug gets fixed soon, so that we can update react native.

Desintegrator commented 1 year ago

same

talal-tilted commented 1 year ago

Still same ...

alwazqazi commented 1 year ago

Still Same :(

HousamHatqwa commented 10 months ago

Hello I know my reply is late, but it might help someone

In ComponentViewController.java file:

add this: import android.os.Build;

Then in WindowInsetsCompat function:

// int systemWindowInsetBottom = insets.getInsets(WindowInsetsCompat.Type.ime()).bottom + // insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom - // systemBarsInsets.bottom; int systemWindowInsetBottom = Build.VERSION.SDK_INT > Build.VERSION_CODES.Q ? insets.getInsets(WindowInsetsCompat.Type.ime()).bottom + insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom - systemBarsInsets.bottom : 0;

connor-wj-kang commented 7 months ago

Hi, same issue here. My work around is hiding keyboard before navigation. use Keyboard.dismiss() provided by react native.