diff --git a/src/utils.ts b/src/utils.ts index 0993b0acb..7a9576acb 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -178,7 +178,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;