diff --git a/js/angular/service/popover.js b/js/angular/service/popover.js index d7a365cb28d..53d44fc7682 100644 --- a/js/angular/service/popover.js +++ b/js/angular/service/popover.js @@ -93,8 +93,9 @@ function($ionicModal, $ionicPosition, $document, $window) { var buttonOffset = $ionicPosition.offset(targetEle); var popoverWidth = popoverEle.prop('offsetWidth'); var popoverHeight = popoverEle.prop('offsetHeight'); - var bodyWidth = $document[0].body.clientWidth; - // clientHeight doesn't work on all platforms for body + // Use innerWidth and innerHeight, because clientWidth and clientHeight + // doesn't work consistently for body on all platforms + var bodyWidth = $window.innerWidth; var bodyHeight = $window.innerHeight; var popoverCSS = {