x-ui-design 0.9.78 → 0.9.80

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
@@ -2709,7 +2709,13 @@ const usePopupPosition = ({
2709
2709
  } else if (Math.abs(availableSpace.left) + container.width > popupRect.width) {
2710
2710
  newPlacement = newPlacement.replace('Right', 'Left');
2711
2711
  } else {
2712
- newPlacement = newPlacement.replace(/Left|Right/, '');
2712
+ if (inBody) {
2713
+ if (window.innerWidth - (container.left + container.width) < popupRect.width && container.left + container.width < popupRect.width) {
2714
+ newPlacement = newPlacement.replace(/Left|Right/, '');
2715
+ }
2716
+ } else {
2717
+ newPlacement = newPlacement.replace(/Left|Right/, '');
2718
+ }
2713
2719
  }
2714
2720
  }
2715
2721
  }