From 0f55359b49b0abc157957d42f98e3f7b4d25ca18 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 25 Sep 2019 08:43:02 +0300 Subject: [PATCH] fix --- src/services/offset_finder/offset_finder.service.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/services/offset_finder/offset_finder.service.js b/src/services/offset_finder/offset_finder.service.js index 1c45bb1a..a8e438b5 100644 --- a/src/services/offset_finder/offset_finder.service.js +++ b/src/services/offset_finder/offset_finder.service.js @@ -13,9 +13,11 @@ export const findOffset = (child, parent, { top = 0, left = 0 } = {}, ignorePadd if (child.offsetParent && (parent === window || parent.contains(child.offsetParent) || parent === child.offsetParent)) { return findOffset(child.offsetParent, parent, result, false) } else { - const { topPadding, leftPadding } = findPadding(parent) - result.top += topPadding - result.left += leftPadding + if (parent !== window) { + const { topPadding, leftPadding } = findPadding(parent) + result.top += topPadding + result.left += leftPadding + } return result } }