question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modal is not visible on stacked page with react-navigation/native-stack

See original GitHub issue

Current behaviour

Modal (or anything inside Portal component) is not visible on stacked pages when I use Native Stack Navigator from react-navigation. It is actually behind the modal screen. Its only working when ‘UIModalPresentationCurrentContext’ is used (for example presentation: 'containedModal'. https://reactnavigation.org/docs/native-stack-navigator#presentation

repro: https://github.com/alesdvorakcz/navigationtest

Simulator Screen Recording - iPhone 13 - 2021-11-05 at 23 57 40

Expected behaviour

I am not 100% sure if a fix/support needs to be done on react native paper side or if its outside of your scope. But at least some explanation in docs would be maybe helpful for other users.

###Environment

software version
ios 15
react-native 0.66.2 (also tested on 0.63.2)
react-native-paper 4.10.0
@react-navigation/native 6.0.6
@react-navigation/native-stack 6.2.5
react-native-screens 3.9.0
react-native-vector-icons 9.0.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
iM-GeeKycommented, Nov 28, 2021

Here is a snack demonstrating the issue as well. @lukewalczak What’s your recommendation on this?

1reaction
iM-GeeKycommented, Dec 6, 2021

Hello, I guess you are missing Portal.Host around your screens. Please take a look on the presented snack and let me know if it fix your issue.

Thanks for the quick response. I did ultimately end up getting it resolved by rearchitecting the navigation, but your solutions works as well. Feel free to close this and thanks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Navigation 6 (RN6) - Card stack within a modal
I found the solution with Nesting navigators as described here. Basically, I created a ModalStack and used this stack in Screen component as...
Read more >
Stack Navigator | React Navigation
Stack Navigator provides a way for your app to transition between screens where each new screen is placed on top of a stack....
Read more >
Using modals in Slack apps
View A remains in the view stack, but is no longer visible or active. The user enters some values into input blocks in...
Read more >
Routing and Navigation - Expo Documentation
... and displaying the appropriate platform-specific navigation-related user ... createNativeStackNavigator } from '@react-navigation/native-stack'; ...
Read more >
Modal - Bootstrap
Below is a static modal example (meaning its position and display have been overridden). Included are the modal header, modal body (required for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found