Skip to content

Commit

Permalink
fix(getContainingBlock): check html in while loop
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Jun 9, 2020
1 parent f2b619b commit 4c8cbba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dom-utils/getOffsetParent.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getTrueOffsetParent(element: Element): ?Element {
function getContainingBlock(element: Element) {
let currentNode = getParentNode(element);

while (getNodeName(currentNode) !== 'body') {
while (['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
if (isHTMLElement(currentNode)) {
const css = getComputedStyle(currentNode);

Expand Down

0 comments on commit 4c8cbba

Please sign in to comment.