Skip to content

iOS: Screen with { presentation: "modal" } navigated to from within another react-native's Modal doesn't open #2048

@bbarthec

Description

@bbarthec

Description

https://github.com/software-mansion/react-native-screens/releases/tag/3.29.0 and #1912 are causing breaking change in behaviour of '@react-navigation/native-stack''s Screen that is mounted with { presentation: "modal" }.

Hiding the react-native's Modal that is the most top component in the view hierarchy prevents Screen with { presentation: "modal" } from showing.
My scenario:

  1. show a BottomSheet that is based on react-native's Modal with an action button
  2. clicking the button should hide the BottomSheet and navigate to { presentation: "modal" } individual Screen
Before 3.29.0 (3.28.0 here) - desired behaviour 3.29.0 - breaking change 3.29.0 - without BottomSheet autohide
Screen.Recording.2024-02-22.at.16.17.37.mov
RPReplay_Final1708615160.mov
RPReplay_Final1708615180.MP4

Steps to reproduce

  1. Open https://snack.expo.dev/@bbarthec/react-native-screens-modal-in-modal-issues
  2. Open the snack in Expo GO (SDK 50 comes with version 3.29.0) on either physical iPhone or Simulator
  3. Open BottomSheet modal & open Screen modal - see Screen is not visible. It's probably mounted using dismissed BottomSheet modal as an anchor component.
  4. Commend out setVisible(false) from line 51 and repeat the process. See the modal Screen properly mounts.

Snack or a link to a repository

https://snack.expo.dev/@bbarthec/react-native-screens-modal-in-modal-issues

Screens version

3.29.0

React Native version

0.73

Platforms

iOS

JavaScript runtime

None

Workflow

None

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

None

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

Labels

Platform: iOSThis issue is specific to iOSRepro providedA reproduction with a snack or repo is provided

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions