x-ui-design 0.9.29 → 0.9.31
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.
- package/dist/index.esm.js +9 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/lib/hooks/usePopupPosition.ts +10 -1
- package/package.json +1 -1
- package/src/app/page.tsx +8 -2
package/dist/index.esm.js
CHANGED
|
@@ -2644,7 +2644,7 @@ const usePopupPosition = ({
|
|
|
2644
2644
|
top: (targetRef.current?.offsetTop || 0) + OFFSET,
|
|
2645
2645
|
left: targetRef.current?.offsetLeft || 0
|
|
2646
2646
|
} : _containsElement ? {
|
|
2647
|
-
top: (targetRef.current?.
|
|
2647
|
+
top: (targetRef.current?.clientTop || 0) + (targetRef.current?.offsetTop || 0) + OFFSET,
|
|
2648
2648
|
left: (targetRef.current?.clientLeft || 0) + (targetRef.current?.offsetLeft || 0)
|
|
2649
2649
|
} : inBody ? {
|
|
2650
2650
|
top: container.top + OFFSET,
|
|
@@ -2675,6 +2675,14 @@ const usePopupPosition = ({
|
|
|
2675
2675
|
left: container.left - (popupRect.width + OFFSET),
|
|
2676
2676
|
right: (inBody ? window.innerWidth : scrollableParents?.clientWidth || 0) - (container.right + popupRect.width + OFFSET)
|
|
2677
2677
|
};
|
|
2678
|
+
console.log({
|
|
2679
|
+
container,
|
|
2680
|
+
popupRect,
|
|
2681
|
+
availableSpace,
|
|
2682
|
+
relativePosition,
|
|
2683
|
+
scrollableParents,
|
|
2684
|
+
targetRef: targetRef.current
|
|
2685
|
+
});
|
|
2678
2686
|
let newPlacement = _placement;
|
|
2679
2687
|
if (availableSpace.bottom < 0 && availableSpace.top > 0) {
|
|
2680
2688
|
newPlacement = newPlacement.replace('bottom', 'top');
|