From 41b76f1390fe6d0927fc81dfddd1a036e98c591e Mon Sep 17 00:00:00 2001 From: GuyPie Date: Fri, 23 Jul 2021 08:29:00 +0300 Subject: [PATCH] Fix position check for tests using jsdom The position is an empty string there, which I think should count as equivalent to static. --- modules/mixins/utils.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/mixins/utils.js b/modules/mixins/utils.js index c6480e5..7b394ef 100644 --- a/modules/mixins/utils.js +++ b/modules/mixins/utils.js @@ -19,8 +19,10 @@ const filterElementInContainer = (container) => (element) => ? container != element && container.contains(element) : !!(container.compareDocumentPosition(element) & 16); -const isPositioned = (element) => - getComputedStyle(element).position !== "static"; +const isPositioned = (element) => { + const position = getComputedStyle(element).position; + return position && position !== "static"; +}; const getElementOffsetInfoUntil = (element, predicate) => { let offsetTop = element.offsetTop;