Skip to content

Incorrect Orientations on iPhone Duo #115

Description

@zbarbuto

Before submitting a new issue

  • I tested using the latest version of the library, as the bug might be already fixed.
  • I tested using a supported version of react native.
  • I checked for possible duplicate issues, with possible answers.

Bug summary

I'm not 100% sure if this is a bug or expected behaviour, but in testing on an iPhone Duo using Xcode 27 I noticed the following:

  1. The orientation is not updated when unfolding the device, the orientation is not updated
  2. The orientations that are reported when rotating an unfolded Duo are not as you would expect

Consider the minimal app in the "Steps to Reproduce" below. A folded iPhone Duo reports portrait for both interface and device orientation which is what we would expect.

Image

However, when we unfold these remain unchanged - the now landscape device is still considered portrait:

Image

As we continue to rotate the unfolded device, the device orientations are the opposite of what we'd expect - with portrait reporting as landscape in the device orientation, while the interface orientation always reports portrait.

Image

No matter how we rotate the device, the interface orientation is always considered portrait and the device is considered landscape for portrait and portrait for landscape. The folded device on the other hand reports as you would expect:

Screen.Recording.2026-09-24.at.1.51.25.pm.mov

Library version

3.0.2

Environment info

System:
  OS: macOS 27.0
  CPU: (12) arm64 Apple M2 Max
  Memory: 452.44 MB / 64.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.3.0
    path: ~/.nvm/versions/node/v24.3.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v24.3.0/bin/yarn
  npm:
    version: 11.15.0
    path: ~/.nvm/versions/node/v24.3.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: ~/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 27.0
      - iOS 27.1
      - macOS 27.0
      - tvOS 27.0
      - visionOS 27.0
      - watchOS 27.0
  Android SDK:
    API Levels:
      - "29"
      - "31"
      - "33"
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 29.0.3
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
      - 35.0.0
      - 36.0.0
      - 36.1.0
    System Images:
      - android-28 | Google ARM64-V8a Play ARM 64 v8a
      - android-29 | Google Play ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
      - android-35 | Google Play Tablet ARM 64 v8a
      - android-36 | Google Play ARM 64 v8a
      - android-37.0 | Pre-Release 16 KB Page Size Google Play ARM 64 v8a
      - android-37.1 | 16 KB Page Size Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2025.3 AI-253.31033.145.2533.15113396
  Xcode:
    version: 27.1/27A9269
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.14
    path: ~/.jenv/shims/javac
  Ruby:
    version: 2.7.2
    path: ~/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.1.0
    wanted: 20.1.0
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.86.0
    wanted: 0.86.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Steps to reproduce

  const interfaceOrientation = useInterfaceOrientation();
  const deviceOrientation = useDeviceOrientation();
  const interfaceLabel = Object.keys(Orientation).find(
    key =>
      Orientation[key as keyof typeof Orientation] === interfaceOrientation,
  );
  const deviceLabel = Object.keys(Orientation).find(
    key => Orientation[key as keyof typeof Orientation] === deviceOrientation,
  );

  return (
    <View style={styles.container}>
      <Text>
        Interface Orientation: {interfaceOrientation} ({interfaceLabel})
      </Text>
      <Text>
        Device Orientation: {deviceOrientation} ({deviceLabel})
      </Text>
    </View>
  );

React Native does not fully support Xcode 27 yet but can be run by using a diff similar to below:

https://github.com/lodev09/react-native-true-sheet/pull/843/changes#diff-dc87f0be9c8ca3a727efb4fd5d77e6b551d8cee9fe22fea2c07062f907f6507bR15

Reproducible example repository

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions