@likable-hair/svelte 3.1.42 → 3.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -108,7 +108,7 @@ function calcScrollY(elem) {
|
|
|
108
108
|
while (!!parent) {
|
|
109
109
|
scroll += parent.scrollTop;
|
|
110
110
|
let parentPosition = getComputedStyle(parent).position;
|
|
111
|
-
if (parentPosition === "absolute" || parentPosition === "fixed")
|
|
111
|
+
if (parentPosition === "absolute" || parentPosition === "fixed" || parentPosition === "relative")
|
|
112
112
|
break;
|
|
113
113
|
parent = parent.parentElement;
|
|
114
114
|
}
|
|
@@ -121,7 +121,7 @@ $:
|
|
|
121
121
|
while (!!parent) {
|
|
122
122
|
let parentPosition = getComputedStyle(parent).position;
|
|
123
123
|
parent.addEventListener("scroll", refreshMenuPosition);
|
|
124
|
-
if (parentPosition == "absolute" || parentPosition == "fixed")
|
|
124
|
+
if (parentPosition == "absolute" || parentPosition == "fixed" || parentPosition === "relative")
|
|
125
125
|
break;
|
|
126
126
|
parent = parent.parentElement;
|
|
127
127
|
}
|
|
@@ -204,7 +204,7 @@ $:
|
|
|
204
204
|
function getPositionedAncestor(elem) {
|
|
205
205
|
if (!elem)
|
|
206
206
|
return null;
|
|
207
|
-
if (["fixed", "absolute", "sticky"].includes(getComputedStyle(elem).position))
|
|
207
|
+
if (["fixed", "absolute", "sticky", "relative"].includes(getComputedStyle(elem).position))
|
|
208
208
|
return elem;
|
|
209
209
|
return getPositionedAncestor(elem.parentElement);
|
|
210
210
|
}
|
|
@@ -224,7 +224,7 @@ function getParentInstanceFromViewport(activatorParent) {
|
|
|
224
224
|
const computedStyle = getComputedStyle(currentParent);
|
|
225
225
|
const position = computedStyle.position;
|
|
226
226
|
const display = computedStyle.display;
|
|
227
|
-
if ((position === "fixed" || position === "absolute") && display === "flex") {
|
|
227
|
+
if ((position === "fixed" || position === "absolute" || position === "relative") && display === "flex") {
|
|
228
228
|
const boundingClientRect = activatorParent.getBoundingClientRect();
|
|
229
229
|
top = top + boundingClientRect.top;
|
|
230
230
|
left = left + boundingClientRect.left;
|