Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen orientation change hack seems no longer needed #13

Open
viking2917 opened this issue Jan 9, 2025 · 0 comments
Open

Screen orientation change hack seems no longer needed #13

viking2917 opened this issue Jan 9, 2025 · 0 comments

Comments

@viking2917
Copy link

Describe the bug
The example code contains the following:

  if (this.platform.is('ios')) {
        // On iOS the landscape-primary and landscape-secondary are flipped for some reason
        if (orientation.type === 'landscape-primary') {
          orientation.type = 'landscape-secondary'
        } else if (orientation.type === 'landscape-secondary') {
          orientation.type = 'landscape-primary'
        }
    }

On iOS 18, with the latest version of the Screen Orientation plugin, this no longer appears necessary, and in fact produces upside-down previews.

To Reproduce
Steps to reproduce the behavior:

  1. Run the example code in an app on iOS
  2. Switch to landscape mode.
  3. The screen will double-rotate and appear upside down.
  4. If that code is removed, the orientation is as-expected.

Expected behavior
The screen should not double-rotate.

Screenshots

Desktop (please complete the following information):

  • OS: [e.g. iOS] MacOS
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6] iPhone 15 Pro
  • OS: [e.g. iOS8.1] iOS 18.1.1
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22] Capacitor 6

Additional context

$ npx cap ls
[info] Found 24 Capacitor plugins for android:
       @byteowls/[email protected]
       @capacitor-community/[email protected]
       @capacitor-community/[email protected]
       @capacitor-community/[email protected]
       @capacitor-community/[email protected]
       @capacitor-community/[email protected]
       @capacitor-mlkit/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capawesome/[email protected]
       @capgo/[email protected]
       [email protected]
       [email protected]
[info] Found 1 Cordova plugin for android:
       [email protected]
[info] Found 25 Capacitor plugins for ios:
       @byteowls/[email protected]
       @capacitor-community/[email protected]
       @capacitor-community/[email protected]
       @capacitor-community/[email protected]
       @capacitor-community/[email protected]
       @capacitor-community/[email protected]
       @capacitor-mlkit/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capawesome/[email protected]
       @capgo/[email protected]
       [email protected]
       [email protected]
       [email protected]
[info] Found 1 Cordova plugin for ios:
       [email protected]
[info] Listing plugins for web is not possible.

$ ionic info

Ionic:

   Ionic CLI                     : 7.2.0 (<omitted>)
   Ionic Framework               : @ionic/angular 7.8.6
   @angular-devkit/build-angular : 16.2.14
   @angular-devkit/schematics    : 16.2.14
   @angular/cli                  : 16.2.14
   @ionic/angular-toolkit        : 9.0.0

Capacitor:

   Capacitor CLI      : 6.1.2
   @capacitor/android : 6.1.2
   @capacitor/core    : 6.1.2
   @capacitor/ios     : 6.1.2

Utility:

   cordova-res : not installed globally
   native-run  : 2.0.1

System:

   NodeJS : v20.14.0 (<omitted>)
   npm    : 10.7.0
   OS     : macOS Unknown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant