-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Keyboard problems #15
Comments
Thanks for the videos and the reproduction code, it helps. I found it's caused by I will check if I can find a workaround. |
@exzos28 I dug a bit on this.
But as you can see in the comments, this is not ideal since it creates a flickering. Dont' mind the navigation bar here, just focus on the status bar: XRecorder_26092022_144236.mp4The "best" option for me seems to switch XRecorder_26092022_144422.mp4I will update the README accordingly. |
I published a new version with the README update: https://github.com/zoontek/react-native-bars/releases/tag/1.2.3 |
@zoontek Screen.Recording.2022-09-27.at.14.30.45.mov |
@exzos28 I agree, but checked current solutions and there's none viable. |
@zoontek I think we need to implement an api in your library to be able to turn transparent status and navigation bars on and off. It would be great. |
@exzos28 Sure, your company can hire me as a freelancer to take time to add this 🙂 |
@zoontek |
@exzos28 Not really since this is not a feature I see the interest in. As iOS does not have this kind of options, I'd rather keep an uniformed behaviour between the platforms and avoid handling extra issues for a feature I will personally never use. But I will gladly review a fix to keep adjustResize compat with |
I'm onto something: #16 Using React Native built-in screen-20220927-164030.mp4Using screen-20220927-163923.mp4I will reach them soon to see what can cause this. Also, adding https://github.com/android/user-interface-samples/tree/master/WindowInsetsAnimation support would be nice. Erratum: It happens with It can be "fixed" using (taken from react-navigation/react-navigation#3971 (comment)): import { useHeaderHeight } from "@react-navigation/elements";
import * as React from "react";
import { Keyboard, Platform, StatusBar } from "react-native";
export const useHeaderKeyboardVerticalOffset = () => {
const [keyboardShown, setKeyboardShown] = React.useState(false);
const headerHeight = useHeaderHeight();
React.useEffect(() => {
if (Platform.OS !== "android") {
return;
}
const didShowListener = Keyboard.addListener("keyboardDidShow", () => {
setKeyboardShown(true);
});
const didHideListener = Keyboard.addListener("keyboardDidHide", () => {
setKeyboardShown(false);
});
return () => {
didShowListener.remove();
didHideListener.remove();
};
}, []);
return keyboardShown ? headerHeight + (StatusBar.currentHeight ?? 0) : undefined;
};
// USAGE:
const offset = useHeaderKeyboardVerticalOffset();
return (
<SafeAreaView style={[styles.container, { paddingBottom: offset }]}> |
Bug summary
windowSoftInputMode="adjustResize" not working after connecting react-native-bars
Keyboard always opens on top of the screen
The default state of the example from the repository:
Screen.Recording.2022-09-23.at.13.00.09.mov
After removing this line
RNBars.init(this, "dark-content");
android/app/src/main/java/com/rnbootsplashexample/MainActivity.java:26
Screen.Recording.2022-09-23.at.13.00.59.mov
In both cases I have
android:windowSoftInputMode="adjustResize"
in AndroidManifest.And I expect the first case to have the same behavior. But it's not.
Library version
1.2.2
Environment info
Steps to reproduce
This is an example with react-native-bootsplash template
Reproducible sample code
The text was updated successfully, but these errors were encountered: