The 'orientationchange' event is not triggered when rotating device upside-down
Reported by
cristian...@gmail.com,
Sep 14 2017
|
||||||||
Issue descriptionSteps to reproduce the problem: Note: This works as expected on a Nexus 7 tablet running Android v6.0.1 and Chrome v60.0.3112.116. However the problem can be reproduced when using a Pixel Phone running Android v8.0.0 and Chrome v60.0.3112.116 (same version as above.) 1. Add event listener for 'orientationchange' 2. Rotate device to 'portrait-secondary' orientation See https://jsfiddle.net/n2g1btsq/ for an example, or use the following code: <script> window.addEventListener('orientationchange', () => { document.getElementsByTagName('body')[0].innerText = screen.orientation.type; }, false); </script> What is the expected behavior? When rotating the device into portrait-primary orientation, the event handler should be invoked (in the example above, "portrait-primary" should be rendered inside <body/>.) What went wrong? The registered event handler is not called. It is however called when rotating the device in all other orientations (portrait-primary, landscape-primary, landscape-secondary) Did this work before? N/A Does this work in other browsers? N/A Chrome version: 60.0.3112.116 Channel: stable OS Version: 8.0.0 Flash Version:
,
Sep 15 2017
,
Sep 15 2017
Able to reproduce the issue in Android and seems to be a Non-Regression issue as same behavior is seen since M58. Observed the event is not invoking to portrait-secondary on rotating the device upside down. Steps Followed 1. Launched Browser 2. Navigated to https://jsfiddle.net/n2g1btsq/ 3. Rotated the device in both landscape and portrait orientation. 4. Observed event is not invoking to portrait-secondary on rotating the device upside down. Chrome versions tested 60.0.3112.116 OS Android 8.0.0 Android Devices Pixel Build/OPR1 170623.027 Please find the logs & video below go/chrome-androidlogs/765381 Thanks!!
,
Sep 15 2017
,
Sep 15 2017
,
Sep 19 2017
I think the "Components" of this bug should be labelled as "Blink>ScreenOrientation" instead of "Blink>Sensor>DeviceOrientation", since it is related to the screen orientation API.
,
Sep 20 2017
,
Sep 20 2017
This isn't a bug: the screen orientation doesn't actually change as by default portrait-secondary can't be used. It should work if you lock the orientation to 'any' then reproduce the steps as above. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by cristian...@gmail.com
, Sep 15 2017