kirillzyusko / react-native-keyboard-controller

Keyboard manager which works in identical way on both iOS and Android
https://kirillzyusko.github.io/react-native-keyboard-controller/
MIT License
1.38k stars 55 forks source link

fix: missing `navigationBar` height in keyboard size if `navigationBar` is `translucent` #469

Closed kirillzyusko closed 3 weeks ago

kirillzyusko commented 3 weeks ago

📜 Description

Keyboard size is incorrectly reported if we draw behind navigation status bar (i. e. it's translucent). This PR fixes this by omitting the -navigationBarHeight if navigationBar is translucent.

💡 Motivation and Context

It's incorrect behavior in the core of the library and should be fixed 👀

Originally discussed in https://github.com/kirillzyusko/react-native-keyboard-controller/issues/259#issuecomment-1848966075

Maybe there is better solution which don't directly depends on navigationBarTrasnlucent property, but to fix this bug right now let's use this code. Later on we can always improve/refactor the code.

📢 Changelog

Android

🤔 How Has This Been Tested?

Tested manually on Pixel 7 Pro and on CI (via e2e tests).

📸 Screenshots (if appropriate):

Tested on Pixel 7 Pro (Android 14):

Before After
telegram-cloud-photo-size-2-5427266154814104062-y telegram-cloud-photo-size-2-5427266154814104063-y

📝 Checklist

github-actions[bot] commented 3 weeks ago

📊 Package size report

Current size Target Size Difference
138194 bytes 138151 bytes 43 bytes 📈