x-ui-design 0.8.94 → 0.8.95
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 +1 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/lib/hooks/usePopupPosition.ts +1 -5
- package/package.json +1 -1
- package/src/app/page.tsx +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -2657,7 +2657,7 @@ const usePopupPosition = ({
|
|
|
2657
2657
|
const popupRect = popupRef.current.getBoundingClientRect();
|
|
2658
2658
|
const availableSpace = {
|
|
2659
2659
|
top: container.top - (popupRect.height + OFFSET),
|
|
2660
|
-
bottom: (scrollableParents?.clientHeight || 0) - (container.bottom + popupRect.height + OFFSET),
|
|
2660
|
+
bottom: (inBody ? window.innerWidth : scrollableParents?.clientHeight || 0) - (container.bottom + popupRect.height + OFFSET),
|
|
2661
2661
|
left: container.left - (popupRect.width + OFFSET),
|
|
2662
2662
|
right: (inBody ? window.innerWidth : scrollableParents?.clientWidth || 0) - (container.right + popupRect.width + OFFSET)
|
|
2663
2663
|
};
|
|
@@ -2674,10 +2674,6 @@ const usePopupPosition = ({
|
|
|
2674
2674
|
if (availableSpace.right < 0 && availableSpace.left > 0) {
|
|
2675
2675
|
newPlacement = newPlacement.replace('Left', 'Right');
|
|
2676
2676
|
}
|
|
2677
|
-
console.info({
|
|
2678
|
-
availableSpace,
|
|
2679
|
-
inBody
|
|
2680
|
-
});
|
|
2681
2677
|
if (availableSpace.right < 0 && availableSpace.left < 0) {
|
|
2682
2678
|
if (newPlacement.includes('Right')) {
|
|
2683
2679
|
positions.left = popupRef.current.clientWidth - positions.left + container.left;
|