diff --git a/js/angular/controller/infiniteScrollController.js b/js/angular/controller/infiniteScrollController.js index f461a32efa4..ebb1b5426bd 100644 --- a/js/angular/controller/infiniteScrollController.js +++ b/js/angular/controller/infiniteScrollController.js @@ -100,13 +100,15 @@ function($scope, $attrs, $element, $timeout) { }; var computedStyle = window.getComputedStyle(self.scrollEl) || {}; return { - left: computedStyle.overflowX === 'scroll' || - computedStyle.overflowX === 'auto' || - self.scrollEl.style['overflow-x'] === 'scroll' ? + left: maxValues.left && + (computedStyle.overflowX === 'scroll' || + computedStyle.overflowX === 'auto' || + self.scrollEl.style['overflow-x'] === 'scroll') ? calculateMaxValue(maxValues.left) : -1, - top: computedStyle.overflowY === 'scroll' || - computedStyle.overflowY === 'auto' || - self.scrollEl.style['overflow-y'] === 'scroll' ? + top: maxValues.top && + (computedStyle.overflowY === 'scroll' || + computedStyle.overflowY === 'auto' || + self.scrollEl.style['overflow-y'] === 'scroll' ) ? calculateMaxValue(maxValues.top) : -1 }; };