ionic-team / ionic-team/capacitor-plugins
feat(@capacitor/screen-orientation): Orientation 'landscape' lock should use current held landscape if any
- Dominant language
- Java
- Stars
- 678
- Forks
- 685
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 3
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
Contributor guide
Assessment
This issue has not been assessed yet.