Monaca Onsen UI Discord Chat Github Repo

Bug with ons.orientation

  • Hello,

    Android 5 and 6, default Monaca project - Onsen 2.0.3, Cordova 6.2.0, Crosswalk 1.7.2, debug buid.

    Very simple Onsen app:

        <ons-button onclick="alert('isPortrait='+ons.orientation.isPortrait())">Orientation</ons-button>

    This code work correctly with system WebView.
    But when you add Crosswalk to the project you can see bug:
    The first time after the app launch orientation is detected correctly. You can chage orientation again and again and this code work fine.
    Close the app with phone Back button.
    Start the app again.
    Orientation inversed (for portrait reported landscape and vice versa).
    Close the app and remove app from the memory (clear launched apps from Android menu).
    Start the app again - orientation is detected correctly.

    It seems that going to the background invoke some mess for orientation detection.

  • Onsen UI

    @Sergey Hey! Thanks for reporting but could you please open an issue on Github? We prefer bug reports there. This is more for questions and howtos. Thanks!