-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
[MIUI] Navigation Bar re-appears when app is foregrounded #66
Comments
@unendingblue By |
@zoontek By re-appearing, I mean that the navigation bar animates from the bottom-up when the user taps anywhere on the app after it's foregrounded. It does not go away at all afterwards.
The style of the bar seemingly plays no role, as I have tried a few already. I have sent a bare minimum build to the user with a blank App.tsx to see if the issue occurs again. If it does, I'll dig deeper and share the package.json used. |
Issue is still present on a bare minimum build with a blank App.tsx. Here's the package.json: "expo": "^52.0.23",
"expo-build-properties": "~0.13.1",
"expo-constants": "~17.0.3",
"expo-dev-client": "~5.0.8",
"expo-font": "~13.0.2",
"expo-updates": "~0.26.10",
"react": "18.3.1",
"react-native": "0.76.5",
"react-native-edge-to-edge": "^1.4.2",
"react-native-gesture-handler": "^2.22.0",
"react-native-reanimated": "^3.16.7",
"react-native-safe-area-context": "^5.1.0" import { ReducedMotionConfig, ReduceMotion } from 'react-native-reanimated';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { SystemBars } from 'react-native-edge-to-edge';
import { useFonts } from 'expo-font';
const App = () => {
const [fontsLoaded] = useFonts({ ... });
if (!fontsLoaded) return;
return (
<GestureHandlerRootView style={{ flex: 1, backgroundColor: '#CCCCCC' }}>
<SafeAreaProvider style={{ flex: 1 }}>
<ReducedMotionConfig mode={ReduceMotion.Never} />
<SystemBars style='dark' hidden={{ statusBar: false, navigationBar: true }} />
</SafeAreaProvider>
</GestureHandlerRootView>
);
}; |
@unendingblue Looks like an Android issue: libsdl-org/SDL#8995 |
That's quite an odd issue, but maybe it's related to landscape mode? In my case the app is always in portrait mode. |
@unendingblue I tried to reproduce it, but cannot (Pixel 4a, Android 13). screen-20250123-182100.mp4 |
I ended up creating a build that only has Expo & Something worth noting, the first bar appears in dark theme, and the second one (in-app) follows the plugin settings ( untitled.mp4 |
@unendingblue Immersive mode only exists in dark (https://developer.android.com/develop/ui/views/layout/immersive) But when the app regain focus, it appears that the nav bar immersive mode is disabled by the OS. Can you provide more infos about the phone? Brand, model and android version?
As I can't reproduce it, maybe it's worth it to share the repo. |
The device is a Redmi Note 8 running Android 11 with MIUI 12.5.2 Stable. I'm also pretty sure at this point that it's likely an issue with Xiaomi's system patches. I honestly think a repo won't help debug this. The biggest challenge here is not having access to the physical device, though it seems more people have issues with the navigation bar appearing in immersive mode in general. For now, I think we can close this issue as not a bug with the |
I already had MIUI only issues on Bootsplash too, it's terrible. I don't have access to a Xiaomi device (only Pixels), and they don't provide emulators 😕 |
Yeah, it's very poorly made. For reference, here's what I've found: https://xiaomi.eu/community/threads/navigation-bar-bug.68171/?utm_source=chatgpt.com |
@unendingblue I published a beta version that re-apply statusBarHidden / navigationBarHidden when the app regains focus. I have no idea if it will have an impact and can't experiment the potential fix without a physical MIUI phone. Could you try it and give me your feedback? yarn add react-native-edge-to-edge@next |
@zoontek This fixed it! The navigation bar now stays hidden at all times. I might be experiencing some safe area hiccups though, as if the bottom inset still considers the bar to be visible. Not sure yet, I'll keep looking and let you know. |
@zoontek The user has reported the issue with MIUI has been resolved. I additionally found the below issues via the emulator: 1. Expo builds fail for iOS 2. SystemBars may not be correctly recognizing system navigation type changes 3. Inset bug with useAnimatedKeyboard What's curious is that console log (even inside the |
This package is a simple Turbomodule, with only an Android part (no ios directory, no podspec). Is this one really from the library? Can you share the error screenshot / stack?
Are you mentionning the system bar style? It's height? (
Are you correctly setting |
@unendingblue I published a new beta, as I think only a part of the fix is really useful. Could you try it and confirms that it continues to be OK on MIUI? I also removed the union in the TurboModule (not in a struct, but used as argument, so I doubt this is the issue). |
I've sent the user a build with the new version, I'll let you know when I hear back. Regarding the other issues: 1. Expo builds fail for iOS 2. SystemBars may not be correctly recognizing system navigation type changes 3. Inset bug with useAnimatedKeyboard |
Given that "Everything that is doable with bare React Native should be doable in Expo", something might be wrong on their side here, as union are supported in RN Codegen. Let's keep
Even with the beta? As the visibility config is applied each time the app regains focus, it should also tackle this. I tried it, no issue: Untitled.mp4
Then it's an issue on their side. You should open an issue on their repository, as it could occurs with every lib capable of enabling immersive mode. I published 1.4.3 with the MIUI fix, let me know in a future issue if there's something else. Thanks for your help on this! 🙏 |
Before submitting a new issue
Bug summary
The Navigation Bar re-appears when the app goes from background, back into foreground.
I am unable to reproduce this on an emulator and unfortunately do not have access to the device this behavior occurs on, I have nonetheless visually confirmed it does occur.
I previously had an issue with Reanimated's
useAnimatedKeyboard
hook, so I provided the user with a build that has it completely removed. The issue persisted.I am not familiar with native Android, but would it be possible that apart from
onResume
, edge-to-edge also needs to be explicitly applied toonWindowFocusChanged
?Library version
1.4.2
Environment info
Steps to reproduce
Reproducible sample code
The text was updated successfully, but these errors were encountered: