feat(@capacitor/screen-orientation): Orientation 'landscape' lock should use current held landscape if any
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
- 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
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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ionic-team/capacitor-plugins
-
[@capacitor/app] iOS: 'Expression implicitly coerced from String? to Any' warning in getAppLanguageOpentriage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
ionic-team/capacitor-plugins#2604 ·
-
platform: ios
Difficulty 4/5 3-5 days Newbie friendliness 58/100
ionic-team/capacitor-plugins#2603 · 1 comment ·
-
platform: android
Difficulty 3/5 1-2 days Newbie friendliness 76/100
ionic-team/capacitor-plugins#2599 ·
-
platform: ios
Difficulty 3/5 1-2 days Newbie friendliness 68/100
ionic-team/capacitor-plugins#2595 · 1 reaction ·
-
platform: android triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ionic-team/capacitor-plugins#2593 ·
All issues in ionic-team/capacitor-plugins
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
beehive-lab/TornadoVM#1151 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
FasterXML/jackson-dataformats-binary#823 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day