Merge pull request #297 from QingWei-Li/fix/popper.js

Fix popper.js bug in IE, #291
pull/299/head
杨奕 2016-10-10 11:37:53 +08:00 committed by GitHub
commit d18271eb61
1 changed files with 4 additions and 1 deletions

View File

@ -1058,7 +1058,10 @@
['scroll', 'auto'].indexOf(getStyleComputedProperty(element, 'overflow-x')) !== -1 ||
['scroll', 'auto'].indexOf(getStyleComputedProperty(element, 'overflow-y')) !== -1
) {
return element;
// If the detected scrollParent is body, we perform an additional check on its parentNode
// in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
// fixes issue #65
return element === root.document.body ? getScrollParent(element.parentNode) : element;
}
return element.parentNode ? getScrollParent(element.parentNode) : element;
}