Skip to content

Orientation Bugs with transparentModal and containedTransparentModal #2006

@amadeus

Description

@amadeus

Description

I've found two classes of orientation bugs related to transparentModal and containedTransparentModal. I've also created a small demo react native project that shows off these two bugs in isolation. One interesting thing to note -- when I was trying to reproduce these in an Expo project, the transparentModal bug did not reproduce, only in a vanilla react-native project which I've attached a link for here: https://github.com/amadeus/react-navigation-bug

These bugs apply to iOS only, as far as I can tell.

Steps to reproduce

transparentModal Bug:

  1. Spawn a screen with transparentModal
  2. Dismiss that view
  3. Notice how safe areas are now locked to the portrait values regardless of orientation change?

This bug does not get triggered by any other modal type. Here's a video showing the bug:

RPReplay_Final1702609019.1.mov

Notice after i've spawned the transparentModal, all subsequent rotations show portrait safe areas in landscape orientation?

It also gets a bit weird if you spawn the modals in landscape the entire time -- notice when finally dismissing the transparent modal, the safe areas only break then:

RPReplay_Final1702609237.mov

containedTransparentModal Bug:

In trying to work around this issue on Discord with containedTransparentModal, I found another bug with containedTransparentModal where it breaks if you rotate the screen with the containedTransparentModal showing:

  1. Spawn a containedTransparentModal
  2. Rotate screen
  3. Notice how containedTransparentModal doesn't seem to update it's dimensions with the new rotated size?
RPReplay_Final1704762550.mov

Snack or a link to a repository

https://github.com/amadeus/react-navigation-bug

Screens version

3.25.0 (but it appears to even repro in the latest version)

React Native version

0.73.0

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Real device

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing infoThe user didn't precise the problem enoughPlatform: 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