diff --git a/src/utils.js b/src/utils.js index 5dcc81e6f..09a3ce02e 100644 --- a/src/utils.js +++ b/src/utils.js @@ -177,7 +177,7 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS height, width; - if (el !== window && el !== getWindowScrollingElement()) { + if (el !== window && el.parentNode && el !== getWindowScrollingElement()) { elRect = el.getBoundingClientRect(); top = elRect.top; left = elRect.left;