Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11991

Locking screen orientation causes viewport glitch

    XMLWordPrintableJSON

Details

    Description

      I develop an app that has both cordova-plugin-screen-orientation and cordova-plugin-statusbar plugins installed.

      When my JS code executes this command:

      screen.lockOrientation('landscape');
      

      the screen rotates and oftentimes turns into something like this: https://drive.google.com/open?id=0B6XpnKFCvexaclBvc09STmhzMUU

      The viewport becomes clipped. I checked in Safari Inspector - the issue is with the viewport, not with CSS - window.innerHeight reports ~100, and window.innerWidth ~1000 (which is obviously not how it should be).

      It doesn't happen all the time. The lighter the page, the harder it is to reproduce.

      I looked into the source code of the StatusBar plugin, and it looks like it does some viewport resizing (there's a function called "resizeWebView") that might cause the described issue. Maybe it gets executed when screen rotates but fails to determine the proper screen dimensions to adjust the viewport.

      Attachments

        Issue Links

          Activity

            People

              jcesarmobile jcesarmobile
              keleran Dmitry Chekanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: