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

not hidding the status and navigation bar in modal

Open rehan-taiftec opened this issue 2 years ago • 17 comments
trafficstars

Description

I am using a modal from react-native i wanted to hide the status bar and navigation bar on modal as well but its showing on the modal Screenshot 2023-05-04 at 10 25 30 AM

react-native-system-navigation-bar version

2.6.0

React Native version

0.71

Snack, code example, screenshot, or link to a repository

No response

rehan-taiftec avatar May 04 '23 05:05 rehan-taiftec

Hi @rehan-taiftec, can you share the snack code so I can test it?

kadiraydinli avatar May 04 '23 10:05 kadiraydinli

@kadiraydinli

Same issue here. 🥺

Description

I want to use Immersive mode to cover both the status bar and the bottom navigation, but when I use the modal provided by react-native, the bottom navigation is visible.

react-native-system-navigation-bar version

2.6.0

React Native version

0.71.6

Snack, code example, screenshot, or link to a repository

// ImmersiveModeHandler.js
import { AppState, Platform } from 'react-native';
import SystemNavigationBar from 'react-native-system-navigation-bar';

import { PLATFORM } from '@Constants';

const setImmersiveMode = () => {
  SystemNavigationBar.immersive();
};

const initImmersiveMode = () => {
  if (Platform.OS === PLATFORM.IOS) {
    return;
  }

  setImmersiveMode();
  AppState.addEventListener('change', setImmersiveMode);
};

export { initImmersiveMode, setImmersiveMode };
// LoadingScreen.jsx
...
componentDidMount = async () => {
   ...
   await Promise.all([setImmersiveMode(), ...]);
  };
// Example > ModalComponent.jsx
import { Modal } from 'react-native';

...

return (
  <Modal
    transparent
    statusBarTranslucent
    visible={modalVisible}
    accessible={false}
    style={getStyle().container}
  > 
...

uncoolclub avatar May 16 '23 09:05 uncoolclub

Hi @uncoolclub, thank you for your comment. 🙏🏼 I was able to see the problem when I tested your snack code. This issue was fixed in react-native before(https://github.com/facebook/react-native/commit/f8a4d281e2be5b68fbebf53f930d37d96236829c), but now it doesn't seem to work properly for Android SDK Level 33 (Android 13). It works correctly when I tested it on Android SDK Level 28 (Android 9). I'm looking at what I can do to fix this issue. I'll let you know when I find a solution.

kadiraydinli avatar May 16 '23 13:05 kadiraydinli

Hello again @uncoolclub , sorry to be back late. This issue is a React Native related issue. If I can find the time and do it, I'm thinking of opening a pull request for this in React Native. Unfortunately this issue cannot be resolved in my package.

kadiraydinli avatar May 24 '23 21:05 kadiraydinli

Hello, @kadiraydinli. It's okay, thanks for comment! I am aware of that. Could you tell me what specifically was an issue in the react native? Is it the same issue as the one you linked above (https://github.com/facebook/react-native/commit/f8a4d281e2be5b68fbebf53f930d37d96236829c)?

uncoolclub avatar May 25 '23 03:05 uncoolclub

Yes,same issue as above link. @uncoolclub

kadiraydinli avatar May 25 '23 06:05 kadiraydinli

Faced with the same problem. There are no workarounds? (rn - 0.71.8)

valery-lavrik avatar May 25 '23 14:05 valery-lavrik

@valery-lavrik As far as I know there is no workaround. Maybe you can patch react-native in your node_modules with patch-package.

kadiraydinli avatar May 25 '23 14:05 kadiraydinli

unfortunately, I don't know react-native so well

valery-lavrik avatar May 25 '23 17:05 valery-lavrik

Faced with the same problem

NazarKuryl0 avatar Sep 06 '23 18:09 NazarKuryl0

same problem here....

JoaoVitorJJV avatar Sep 29 '23 03:09 JoaoVitorJJV

Same problem here!! thanks for the work!

Joaquim-Frances avatar Nov 30 '23 10:11 Joaquim-Frances

Same problem here.

wangchongwei avatar Dec 14 '23 01:12 wangchongwei

Any workarounds? For current react-native, any patch we can apply to fix this?

knro avatar Jan 07 '24 12:01 knro

news?

ciaoamigoschat avatar Mar 22 '24 12:03 ciaoamigoschat

Not working for modals ??

ThilinaHewagama avatar Jun 01 '24 06:06 ThilinaHewagama

Yes in React Native Modal it still show

decky-grande avatar Jul 03 '24 02:07 decky-grande