@likable-hair/svelte 3.0.70 → 3.0.71

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.
@@ -20,7 +20,6 @@ function calculateMenuPosition(params) {
20
20
  _top = activatorTop + activatorHeight + _activatorGap;
21
21
  _left = activatorLeft;
22
22
  let { top: fixedParentTop, left: fixedParentLeft, fixedParent, validStickyParent } = getParentInstanceFromViewport(activator?.parentElement);
23
- console.log(validStickyParent);
24
23
  if (!!fixedParent) {
25
24
  _top = _top - fixedParentTop;
26
25
  _left = _left - fixedParentLeft;
@@ -36,7 +35,6 @@ function calculateMenuPosition(params) {
36
35
  _top = activatorTop + activatorHeight + _activatorGap;
37
36
  _left = activatorLeft;
38
37
  let { top: fixedParentTop, left: fixedParentLeft, fixedParent, validStickyParent } = getParentInstanceFromViewport(activator?.parentElement);
39
- console.log(validStickyParent);
40
38
  if (!!fixedParent) {
41
39
  _top = _top - fixedParentTop;
42
40
  _left = _left - fixedParentLeft;
@@ -83,8 +81,15 @@ function calculateMenuPosition(params) {
83
81
  _left = 0;
84
82
  if (!_top)
85
83
  _top = 0;
86
- _left = _left - positionedAncestorLeft;
87
- _top = _top - positionedAncestorTop;
84
+ _left = _left - (positionedAncestorLeft + window.scrollX);
85
+ _top = _top - (positionedAncestorTop + window.scrollY);
86
+ if (!!activator) {
87
+ let { validStickyParent } = getParentInstanceFromViewport(activator?.parentElement);
88
+ if (!!validStickyParent) {
89
+ _left = _left + window.scrollX;
90
+ _top = _top + window.scrollY;
91
+ }
92
+ }
88
93
  }
89
94
  }
90
95
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@likable-hair/svelte",
3
3
  "description": "A Svelte component for likablehair",
4
- "version": "3.0.70",
4
+ "version": "3.0.71",
5
5
  "scripts": {
6
6
  "host": "vite --host",
7
7
  "dev": "vite dev",