x-ui-design 0.9.12 → 0.9.13
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 +2 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/lib/hooks/usePopupPosition.ts +2 -7
- package/package.json +1 -1
- package/src/app/page.tsx +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -2673,10 +2673,10 @@ const usePopupPosition = ({
|
|
|
2673
2673
|
if (availableSpace.top < 0 && availableSpace.bottom > 0) {
|
|
2674
2674
|
newPlacement = newPlacement.replace('top', 'bottom');
|
|
2675
2675
|
}
|
|
2676
|
-
if (availableSpace.left < 0 && availableSpace.right > 0) {
|
|
2676
|
+
if (availableSpace.left < 0 && (availableSpace.right > 0 || availableSpace.right < popupRect.width)) {
|
|
2677
2677
|
newPlacement = newPlacement.replace('Right', 'Left');
|
|
2678
2678
|
}
|
|
2679
|
-
if (availableSpace.right < 0 && availableSpace.left > 0) {
|
|
2679
|
+
if (availableSpace.right < 0 && (availableSpace.left > 0 || availableSpace.left < popupRect.width)) {
|
|
2680
2680
|
newPlacement = newPlacement.replace('Left', 'Right');
|
|
2681
2681
|
}
|
|
2682
2682
|
if (availableSpace.right < 0 && availableSpace.left < 0) {
|
|
@@ -2687,10 +2687,6 @@ const usePopupPosition = ({
|
|
|
2687
2687
|
positions.left = positions.left - popupRef.current.clientWidth + container.width;
|
|
2688
2688
|
}
|
|
2689
2689
|
}
|
|
2690
|
-
console.log({
|
|
2691
|
-
newPlacement,
|
|
2692
|
-
availableSpace
|
|
2693
|
-
});
|
|
2694
2690
|
_setPlacement(newPlacement);
|
|
2695
2691
|
}
|
|
2696
2692
|
const _calculation = () => {
|