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

With the 3.0.2 version, the turn orientation change for iOS on landscape mode #56

Open
2 tasks
Stephane84 opened this issue Jul 4, 2019 · 6 comments
Open
2 tasks

Comments

@Stephane84
Copy link

Stephane84 commented Jul 4, 2019

Bug Report

Problem

With the 3.0.2 version, the turn orientation change for iOS on landscape mode

What is expected to happen?

I have an ionic3 app in portrait mode, fixed in config.xml :

in 3.0.1, when using ionic native : this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
the app turn right, and we turn the device on left to have the top of the device on left
I use this orientation on a specific page, not on all

What does actually happen?

in 3.0.2 :
the app turn left, and we turn the device on right to have the top of the device on right

Information

Seems to be this PR who include the bug : #25

Command or Code

this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);

Environment, Platform, Device

on iOS only, android still work well

Version information

"@ionic-native/screen-orientation": "4.7.0",
"ionic-angular": "3.9.2",
"cordova-plugin-screen-orientation": "3.0.2",

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • [x ] I included all the necessary information above
@janpio
Copy link
Member

janpio commented Jul 4, 2019

As I understand the PR this was actually a bug on iOS before (vs. how it should work and how it works on other platforms) that has been fixed there. Do you disagree?

@Stephane84
Copy link
Author

Well, as i understand, there was a bug when in landscape mode, doing screen.orientation.lock(landscape);, it flips to the opposite landscape
i don't have this case in my app.
My app is fixed in portrait, and i switch from portrait to landscape and landscape to portrait only with 2 different button (one in a page, the other in a modal)

For my app, the PR solve no problem ,but add this issue

@janpio
Copy link
Member

janpio commented Jul 4, 2019

Can you visualize this with screenshots or even better a repro app? I am not sure I fully understand what is going on.

@Asterodeia
Copy link

Asterodeia commented Jul 8, 2019

Sorry for the poor screenshot edited in paint quality, but here is the problem

image

Our ionic application is fixed in portrait in config.xml

<preference name="Orientation" value="portrait" />

The only time we switch to landcape is when clicking on the arrow (in red in my beautiful screenshot). typescript code is

this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);

(we are using ionic-native adaptation of the plugin : https://ionicframework.com/docs/native/screen-orientation/ )

With 3.0.1 plugin, both android and iphone were rotating in the same direction (top one on screenshot), so counter clockwise
With 3.0.2 plugin, iphone is rotating clockwise

@janpio
Copy link
Member

janpio commented Jul 8, 2019

Thank you! And I though the bugfix in 3.0.2 would actually fix this to be correct...

Can you create a new project with some minimal pages that reproduces this problem? I need to look at it myself. (Ionic is fine in this case - but if you want to do it in plain Cordova you of course get bonus points)

@Anuj-logiciel
Copy link

@Stephane84 - Just try once from here, Seems it will work for you.
https://github.com/Anuj-logiciel/cordova-plugin-screen-orientation

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

4 participants