dmitry-platogo opened a new issue, #117:
URL: https://github.com/apache/cordova-plugin-screen-orientation/issues/117

   # Bug Report
   
   ## Problem
   Native support of ScreenOrienation was introduced in [Safari 
16.4](https://developer.apple.com/documentation/safari-release-notes/safari-16_4-release-notes):
   > Added support for ScreenOrientation.type, ScreenOrientation.angle, and 
ScreenOrientation.onchange.
   
   So the native (browser) support for `window.screen.orientation.type` was 
added, but added wrong.
   
   In Cordova's implementation it is done according to [W3 
spec](https://w3c.github.io/screen-orientation/#the-current-screen-orientation-type-and-angle):
   > For screens with a natural portrait orientation:
   portrait-primary: 0°
   landscape-primary: 90°
   portrait-secondary: 180°
   landscape-secondary: 270°
   
   But for Safari 16.4 when `window.orientation` value is `90`, then 
`screen.orientation.type` value is `landscape-secondary` (and when `-90` (e.g. 
270) then `landscape-primary`). So `landscape-primary` and 
`landscape-secondary` are mixed up.
   
   Although it looks like a Safari bug, I can no longer rely on 
`window.screen.orientation.type` value shipped by 
`cordova-plugin-screen-orientation` plugin, I had to switch to 
`window.orientation` in my code. 
   
   Maybe the incorrect Safari behaviour could be fixed inside the plugin, so 
the value of `window.screen.orientation.type` would stay consistent in any iOs 
version?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to