react-navigation / react-navigation/react-navigation

[Android] Previous screen invisible when going back in nested stack with ModalPresentationIOS

Open
#10,217 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug package:stack platform:android repro provided
Dominant language
TypeScript
Stars
24.5k
Forks
5.1k
Avg merge
1d 5h
Merged PRs (30d)
18

Description

Current behavior

When using the transitionPreset ModalPresentationIOS on Android in a nested stack, going back to the previous screen causes said previous screen to be invisible, showing the root screen.

This can actually be seen in the official snack in the documentation about ModalPresentationIOS:

  • Starting on the Home Screen
  • Open 'Profile Screen'
  • Open 'Settings Screen'
  • Go Back
  • Instead of showing the 'Profile Screen', it is invisible and the 'Home Screen' is shown instead, but still inset because it is supposed to be hidden behind the 'Profile Screen'

This only happens on Android, on IOS it's fine.

Expected behavior

The Screen should not be invisible when going back to it.

Reproduction

https://snack.expo.dev/Og8uXXQ82

Platform
  • Android
  • iOS
  • Web
  • Windows
  • MacOS
Packages
  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-bottom-tabs
  • @react-navigation/material-top-tabs
  • @react-navigation/stack
  • @react-navigation/native-stack
Environment
package version
@react-navigation/native
@react-navigation/bottom-tabs
@react-navigation/drawer
@react-navigation/material-bottom-tabs
@react-navigation/material-top-tabs
@react-navigation/stack ^6.0.11
@react-navigation/native-stack
react-native-safe-area-context
react-native-screens
react-native-gesture-handler
react-native-reanimated
react-native-tab-view
react-native-pager-view
react-native
expo
node
npm or yarn

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked Expo Snack on Android and reproducing the nested stack flow with the ModalPresentationIOS transition in the @react-navigation/stack package. Trace the Android back-navigation path and compare it with iOS; done when returning from Settings shows the Profile screen instead of an invisible screen with the Home screen underneath.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, react-native, typescript
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.