react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

[Android] Going back with open keyboard, half screen

Open Ainias opened this issue 1 year ago • 11 comments

🐛 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

  • React Native Navigation version: 7.29.0 and 7.30.0-alpha (as of 15.08.22)
  • React Native version: 0.67.4
  • Platform(s) (iOS, Android, or both?): Android, API 29
  • Device info (Simulator/Device? OS version? Debug/Release?): real device and emulator

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?

  • ✖️   Yes, I have the time, and I know how to start.
  • ✖️   Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✅   No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

Ainias avatar Aug 17 '22 09:08 Ainias

Same problem

agestaun avatar Aug 17 '22 09:08 agestaun

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

thanksyouall avatar Aug 18 '22 08:08 thanksyouall

any workaround?

kabus202 avatar Aug 24 '22 08:08 kabus202

@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 avatar Sep 19 '22 09:09 Ainias

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

Ainias avatar Sep 21 '22 07:09 Ainias

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.

djschilling avatar Dec 09 '22 09:12 djschilling

same

Desintegrator avatar Dec 26 '22 10:12 Desintegrator

Still same ...

talal-tilted avatar Jan 20 '23 15:01 talal-tilted

Still Same :(

alwazqazi avatar Apr 12 '23 11:04 alwazqazi

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;

HousamHatqwa avatar Jan 15 '24 12:01 HousamHatqwa

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

connor-wj-kang avatar Apr 03 '24 05:04 connor-wj-kang