zeroseven / react-screen-orientation

Display React Components based on screen orientation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Safari / MS Edge bugs

ajlatour opened this issue · comments

I'm trying to force my webapp to be in landscape view only. Having a rotate device message on portrait is appearing on desktop versions of Microsoft Edge and Safari.

Does anyone have any idea what could be causing this?

I just discovered this issue today as well.

It uses Screen API orientation features which aren't supported in Safari and MS Edge
https://developer.mozilla.org/en-US/docs/Web/API/Screen#Browser_compatibility
It also uses window.orientation which isn't supported as well https://developer.mozilla.org/en-US/docs/Web/API/Window/orientation#Browser_compatibility

@groinder It uses the Screen Orientation API and window.orientation as a fallback for browsers that don't support screen.orientation.

@ajlatour It's not possible to lock the orientation in all browsers. For that reason, the example in the README displays a message to rotate the device.