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

Event orientationchange being fired with wrong orientation on iOS Chrome #5762

Closed
meetpatel1989 opened this issue Jun 29, 2021 · 2 comments
Closed

Comments

@meetpatel1989
Copy link

Version

  • Phaser Version: 3.55.2
  • Operating system: iOS 14.6 iPhone 8 Plus
  • Browser: Chrome

Description

The orientation change event is being fired on the chrome browser but with the wrong orientation. This exmaple works fine in the safari but not on the chrome browser.

this.game.scale.on("orientationchange", ()=>{ alert("orientation changed"); });

Additional Information

  • Open this in the ios chrome browser in Portrait mode. (Expected behavior)
  • Rotate the device to the landscape but still it will show to landscape message. (Wrong behavior)
  • Again rotate to portrait. This time it will not show any message while it should show the message for landscape rotation. (Wrong behavior)

My observation: The event is not being fired for the first time only after that event is fired but with the wrong orientation.

@meetpatel1989
Copy link
Author

meetpatel1989 commented Jul 5, 2021

@photonstorm can you please check on this one?

@meetpatel1989 meetpatel1989 changed the title Event orientationchange being fired with wrong orientation Event orientationchange being fired with wrong orientation on iOS Chrome Jul 9, 2021
@photonstorm
Copy link
Collaborator

The ScaleManager.orientationChange event listener will now directly refresh the Scale Manager internals. This fixes an issue where the orientation change event would fire after the window resize event, causing the Scale Manager to incorrectly report the new orientation on Chrome on iOS. See #6484 for the commit link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants