x-ui-design 0.8.93 → 0.8.94

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 CHANGED
@@ -2659,7 +2659,7 @@ const usePopupPosition = ({
2659
2659
  top: container.top - (popupRect.height + OFFSET),
2660
2660
  bottom: (scrollableParents?.clientHeight || 0) - (container.bottom + popupRect.height + OFFSET),
2661
2661
  left: container.left - (popupRect.width + OFFSET),
2662
- right: (scrollableParents?.clientWidth || 0) - (container.right + popupRect.width + OFFSET)
2662
+ right: (inBody ? window.innerWidth : scrollableParents?.clientWidth || 0) - (container.right + popupRect.width + OFFSET)
2663
2663
  };
2664
2664
  let newPlacement = _placement;
2665
2665
  if (availableSpace.bottom < 0 && availableSpace.top > 0) {
@@ -2674,6 +2674,10 @@ 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
+ });
2677
2681
  if (availableSpace.right < 0 && availableSpace.left < 0) {
2678
2682
  if (newPlacement.includes('Right')) {
2679
2683
  positions.left = popupRef.current.clientWidth - positions.left + container.left;