diff --git a/packages/popper/src/utils/getBoundaries.js b/packages/popper/src/utils/getBoundaries.js index 426865ac6f..a05b13f974 100644 --- a/packages/popper/src/utils/getBoundaries.js +++ b/packages/popper/src/utils/getBoundaries.js @@ -50,7 +50,7 @@ export default function getBoundaries( // In case of HTML, we need a different computation if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { - const { height, width } = getWindowSizes(false); + const { height, width } = getWindowSizes(); boundaries.top += offsets.top - offsets.marginTop; boundaries.bottom = height + offsets.top; boundaries.left += offsets.left - offsets.marginLeft; diff --git a/packages/popper/src/utils/getWindowSizes.js b/packages/popper/src/utils/getWindowSizes.js index 8375db65ca..2be386e44e 100644 --- a/packages/popper/src/utils/getWindowSizes.js +++ b/packages/popper/src/utils/getWindowSizes.js @@ -1,12 +1,12 @@ import isIE10 from './isIE10'; -function getSize(axis, body, html, computedStyle, includeScroll) { +function getSize(axis, body, html, computedStyle) { return Math.max( body[`offset${axis}`], - includeScroll ? body[`scroll${axis}`] : 0, + body[`scroll${axis}`], html[`client${axis}`], html[`offset${axis}`], - includeScroll ? html[`scroll${axis}`] : 0, + html[`scroll${axis}`], isIE10() ? html[`offset${axis}`] + computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`] + @@ -15,13 +15,13 @@ function getSize(axis, body, html, computedStyle, includeScroll) { ); } -export default function getWindowSizes(includeScroll = true) { +export default function getWindowSizes() { const body = window.document.body; const html = window.document.documentElement; const computedStyle = isIE10() && window.getComputedStyle(html); return { - height: getSize('Height', body, html, computedStyle, includeScroll), - width: getSize('Width', body, html, computedStyle, includeScroll), + height: getSize('Height', body, html, computedStyle), + width: getSize('Width', body, html, computedStyle), }; }