Thank you for reporting this bug. We will make it our priority to review this report.
-
Sencha User
orientationchange event sends wrong height/width on Android stock browser
Android 4.1.2 emulator, 400x800 screen, Sencha Touch 2.4.2.
Create a page with the following code:
Code:
Ext.Viewport.on('orientationchange', function(viewport, orientation, width, height) {
console.log("orientationchange handler: " + orientation + " " + width + " " + height);
});
Launch in stock browser, in portrait mode. Rotate to landscape. Result is width=320, height=456. This was the width/height in portrait, before the rotation.
Rotate to portrait. Result is width=533, height=291. This was the width/height in landscape, before the rotation.
It's always sending the wrong width/height.
I think this has something to do with the use of the 'orientationchange' event in ST 2.4.2, whereas 'resize' was used before (although that didn't work either, for different reasons.)
If I set Ext.feature.has.OrientationChange to false before the Ext.viewport.Default constructor is called, it uses the 'resize' event instead, and this makes it return the right width/height values (although I don't know what else might break).
-
Thanks for the report! I have opened a bug in our bug tracker.
-
Sencha User
I'm having the same problem. Any news about it? The solution I used at version 2.3.1 does not work anymore.
-
Sencha User
We have the same issue here and it causes big problems for our application on the latest Nexus 9 on Android 5.1.1.
We can see from debugging the code that the orientationchange event is occurring before the screen size has changed. We are considering overriding this detection to defer the orientation check for a few milliseconds, but this is not ideal.
-
Sencha User
For me using resize event instead of orientationChange resolved my issue
-
Sencha User
True, use the resize event