Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#2,039 15 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java, swift
Domain
mobile-dev

Research direction

Start with the orientation-lock handling in ios/Sources/ScreenOrientationPlugin/ScreenOrientation.swift at the referenced line and android/src/main/java/com/capacitorjs/plugins/screenorientation/ScreenOrientation.java. Run the linked reproduction app while holding the device in each landscape direction, then verify that locking to landscape preserves the currently held landscape orientation on both iOS and Android.

Written by the indexing model from the issue text.

Description

platform: android platform: ios type: feature request

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: https://github.com/ionic-team/capacitor-plugins/blob/be3dd6889b5d147cd43ff17ae2cfdb936a146a34/screen-orientation/ios/Sources/ScreenOrientationPlugin/ScreenOrientation.swift#L87
Android: https://github.com/ionic-team/capacitor-plugins/blob/be3dd6889b5d147cd43ff17ae2cfdb936a146a34/screen-orientation/android/src/main/java/com/capacitorjs/plugins/screenorientation/ScreenOrientation.java#L62

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
Dominant language
Java
Stars
682
Forks
689
Avg merge
5d 11h
Merged PRs (30d)
3

Getting set up

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.

More from ionic-team/capacitor-plugins

All issues in ionic-team/capacitor-plugins

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.