Skip to content

feat(@capacitor/screen-orientation): Orientation 'landscape' lock should use current held landscape if any #2039

@codepip55

Description

@codepip55

Bug Report

Plugin(s)

@capacitor/screen-orientation 5.0.7

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 5.7.0
  @capacitor/core: 5.7.0
  @capacitor/android: 5.7.0
  @capacitor/ios: 5.7.0

Installed Dependencies:

  @capacitor/cli: 5.6.0
  @capacitor/android: 5.7.0
  @capacitor/core: 5.7.0
  @capacitor/ios: 5.7.0

Platform(s)

Android and iOS

Current Behavior

When locking the screen orientation to 'landscape' it locks it to landscape left. Meaning that if I'm holding my phone in landscape right mode, the view rotates 180 degrees and locks there. (Same goes for android with landscape and landscape reverse).

You can see this is how its configured in the plugin code:
iOS:


Android:

Expected Behavior

If the phone is physically held in either landscape left or right (normal or reverse for android), when locking the orientation to 'landscape' it should lock the current orientation without rotating anything.

Code Reproduction

This simple app by WIStudent reproduces the problem: https://github.com/WIStudent/capacitor-screen-orientation-issue-reproduction-app/tree/main

Other Technical Details

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions