@@ -569,24 +569,30 @@ export class Platform {
569
569
570
570
// we're keeping track of portrait and landscape dimensions
571
571
// separately because the virtual keyboard can really mess
572
- // up accurate values when the keyboard up
573
- if ( win . screen . width < win . screen . height ) {
574
- this . _isPortrait = true ;
575
- if ( this . _pW < win [ 'innerWidth' ] ) {
576
- this . _pW = win [ 'innerWidth' ] ;
577
- }
578
- if ( this . _pH < win [ 'innerHeight' ] ) {
579
- this . _pH = win [ 'innerHeight' ] ;
580
- }
572
+ // up accurate values when the keyboard is up
573
+ if ( win . screen . width > 0 && win . screen . height > 0 ) {
574
+ if ( win . screen . width < win . screen . height ) {
581
575
582
- } else {
583
- this . _isPortrait = false ;
584
- if ( this . _lW < win [ 'innerWidth' ] ) {
585
- this . _lW = win [ 'innerWidth' ] ;
586
- }
587
- if ( this . _lH < win [ 'innerHeight' ] ) {
588
- this . _lH = win [ 'innerHeight' ] ;
576
+ if ( this . _pW < win [ 'innerWidth' ] ) {
577
+ this . _isPortrait = true ;
578
+ this . _pW = win [ 'innerWidth' ] ;
579
+ }
580
+ if ( this . _pH < win [ 'innerHeight' ] ) {
581
+ this . _isPortrait = true ;
582
+ this . _pH = win [ 'innerHeight' ] ;
583
+ }
584
+
585
+ } else {
586
+ if ( this . _lW < win [ 'innerWidth' ] ) {
587
+ this . _isPortrait = false ;
588
+ this . _lW = win [ 'innerWidth' ] ;
589
+ }
590
+ if ( this . _lH < win [ 'innerHeight' ] ) {
591
+ this . _isPortrait = false ;
592
+ this . _lH = win [ 'innerHeight' ] ;
593
+ }
589
594
}
595
+
590
596
}
591
597
}
592
598
}
0 commit comments