react-native-portal icon indicating copy to clipboard operation
react-native-portal copied to clipboard

Portal not placed over react native navigation tabs

Open andreiwow2 opened this issue 2 years ago • 7 comments

As noticed in the below image, my portal, which is the red background with the input, is placed inbetween the navigation view, I want it to be teleported above everything.

The host is placed in App.tsx like this

<PortalProvider>
      <InternetProvider>
        <StatusBar
          animated
          backgroundColor={colorScheme === 'dark' ? 'white' : 'black'}
          barStyle={colorScheme === 'dark' ? 'light-content' : 'dark-content'}
        />
        <UserProvider>
          <NativeBaseProvider>
            <ApolloProvider client={client}>
              <SafeAreaProvider>
                <NavigationContainer>
                  <Stack.Navigator screenOptions={{ gestureEnabled: false }}>
                    <Stack.Screen
                      options={{ headerShown: false }}
                      name="MainPage"
                      component={MainPage}
                    />
                    <Stack.Screen
                      name="MusterHalle"
                      options={{ title: 'Muster Halle' }}
                      component={MusterHallePage}
                    />
                    <Stack.Screen name="Ersatz" component={ErsatzPage} />
                  </Stack.Navigator>
                </NavigationContainer>
              </SafeAreaProvider>
            </ApolloProvider>
          </NativeBaseProvider>
          <Toast />
          <PortalHost name="mainPortal" />
        </UserProvider>
      </InternetProvider>
    </PortalProvider>

Any idea how could I achieve what I am trying to do?

image

andreiwow2 avatar May 22 '23 11:05 andreiwow2

Exactly the same issue here observed on Android. I've not worked out a solution yet..

Screenshot_20230629-125330

jackdewhurst avatar Jun 29 '23 11:06 jackdewhurst

Other portal libraries like react-native-paper and react-native-portalize behave the same unfortunately..

jackdewhurst avatar Jun 29 '23 12:06 jackdewhurst

You can solve this by using FullWindowOverlay from rn-screens

<Portal>
  <FullWindowOverlay>
  {/* Your component */}
  </FullWindowOverlay>
</Portal>

dentemm avatar Aug 07 '23 06:08 dentemm

You can solve this by using FullWindowOverlay from rn-screens

<Portal>
  <FullWindowOverlay>
  {/* Your component */}
  </FullWindowOverlay>
</Portal>

But this is just valid for IOS

SnowingFox avatar Aug 20 '23 08:08 SnowingFox

You can solve this by using FullWindowOverlay from rn-screens

<Portal>
  <FullWindowOverlay>
  {/* Your component */}
  </FullWindowOverlay>
</Portal>

This works however, when I change the theme it decided to go behind the modal? Then I have to clear cache to make it work :(

jeyjeycodes avatar Aug 20 '23 23:08 jeyjeycodes

add

<Statusbar translucent />

SnowingFox avatar Aug 24 '23 02:08 SnowingFox

If you ment react-native-navigation ( from wix ):

I have to hide the bottom tab bar using mergeOptions

Navigation.mergeOptions(componentId, {
      bottomTabs: {
        visible: false,
        animate: true, // Optional: use it to animate the transition
      },
    });

GhayoorUlHaq avatar Sep 11 '23 06:09 GhayoorUlHaq