react-native-keyboard-controller: KeyboardProvider breaks translucent StatusBar on Android

Describe the bug

My StatusBar is translucent in my android app. As soon as I add KeyboardProvider, it reverts that and leaves a white StatusBar which is not covering the app anymore.

Code snippet

Wrap the app with <KeyboardProvider>

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 26 (24 by maintainers)

Commits related to this issue

Most upvoted comments

@hirbod I could reproduce the issue on my Xiaomi device. Using version from PR and adding statusBarTranslucent to Provider fixes the problem 😊 Could you check it, please? If you confirm it, then I will merge and publish a new version of the library.

I also created a PR here to circumvent the issue in the future with an easy statusBarTranslucent prop: https://github.com/react-navigation/react-navigation/pull/10578

A lot. Expo got just beautiful, specially since custom code is possible in a semi-managed workflow - which is just great. I found out that react-native-screens has a prop statusBarTranslucent which does work with your KeyboardProvider, unfortunately it still has not been ported to react-navigation/native-stack.

I asked satya164 if anything speaks agains porting it. But would still be nice to workaround this anyway.

With KeyboardProvider

image

Without KeyboardProvider

image

@hirbod nice, but anyway I’ll try to figure out as well what’s breaking status bar behaviour in my code 👍 Thanks for the repo again!

@kirillzyusko here is the mcve.

https://github.com/hirbod/keyboard-controller-statusbar-issue-repro

  • clone
  • npm install -g expo-cli
  • yarn
  • expo run:android

I could reproduce the issue. It only happens with @react-navigation/native-stack and react-native-screens

You don’t need to “eject” (aka going bare). But you will need to install expo-dev-client and generate a custom dev client with EAS or Xcode/Android Studio, but you can also build in the cloud for free with EAS. No config plugins are required.

You just can’t use Expo Go, because for that, the native code by this library has to be included, which Expo won’t do anymore, since custom dev clients are very easy to setup and super convenient (+ 50% smaller app size)

This is kind of “semi managed”, but upgrading RN etc is so easy with Expo.

@hirbod side question - do you have steps on how you installed this lib into expo? did you write a config plugin for it?

another side note, thanks @kirillzyusko for hitting the problem of no willShow events on android!!