From 52896ee6b47a82a8f3f8b98b7fb55e4ac8187e7d Mon Sep 17 00:00:00 2001 From: Buchheit Date: Wed, 25 Apr 2018 16:00:19 -0400 Subject: [PATCH] Fixed IE10 problem? --- packages/popper/src/utils/getWindowSizes.js | 8 ++-- packages/popper/tests/unit/getBoundaries.js | 46 +++++++++------------ 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/packages/popper/src/utils/getWindowSizes.js b/packages/popper/src/utils/getWindowSizes.js index a81f106154..1437ad43e3 100644 --- a/packages/popper/src/utils/getWindowSizes.js +++ b/packages/popper/src/utils/getWindowSizes.js @@ -8,10 +8,10 @@ function getSize(axis, body, html, computedStyle) { html[`offset${axis}`], html[`scroll${axis}`], isIE(10) - ? html[`offset${axis}`] + - computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`] + - computedStyle[`margin${axis === 'Height' ? 'Bottom' : 'Right'}`] - : 0 + ? (parseInt(html[`offset${axis}`]) + + parseInt(computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`]) + + parseInt(computedStyle[`margin${axis === 'Height' ? 'Bottom' : 'Right'}`])) + : 0 ); } diff --git a/packages/popper/tests/unit/getBoundaries.js b/packages/popper/tests/unit/getBoundaries.js index fe88cbac20..781537c942 100644 --- a/packages/popper/tests/unit/getBoundaries.js +++ b/packages/popper/tests/unit/getBoundaries.js @@ -67,38 +67,32 @@ describe('utils/getBoundaries', () => { }); it('returns a boundary defined by the document element.', () => { - if(!isIE(10)) { //Test does not work with IE 10 - const result = getBoundaries(popper, node, 0, 'window', true); - expectBoundary(result, { - top: 0, - right: window.innerWidth, - bottom: window.innerHeight, - left: 0, - }); - } + const result = getBoundaries(popper, node, 0, 'window', true); + expectBoundary(result, { + top: 0, + right: window.innerWidth, + bottom: window.innerHeight, + left: 0, + }); }); it('returns a boundary defined by the document element by way of a child reference.', () => { - if(!isIE(10)) { //Test does not work with IE 10 - const result = getBoundaries(popper, spacing, 0, 'scrollParent', true); - expectBoundary(result, { - top: 0, - right: window.innerWidth, - bottom: window.innerHeight, - left: 0, - }); - } + const result = getBoundaries(popper, spacing, 0, 'scrollParent', true); + expectBoundary(result, { + top: 0, + right: window.innerWidth, + bottom: window.innerHeight, + left: 0, + }); }); it('returns a custom defined boundary within the page.', () => { - if(!isIE(10) && !isIE(11)) { //Test does not work with IE 10 or IE 11 const result = getBoundaries(scrollingPopper, scrollingChild, 0, 'scrollParent', true); - expectBoundary(result, { - top: -150, - right: window.innerWidth - 160, - bottom: window.innerHeight - 150, - left: -160, - }); - } + expectBoundary(result, { + top: -150, + right: window.innerWidth - 160, + bottom: window.innerHeight - 150, + left: -160, + }); }); }); \ No newline at end of file