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.js CHANGED
@@ -2675,10 +2675,10 @@ const usePopupPosition = ({
2675
2675
  if (availableSpace.top < 0 && availableSpace.bottom > 0) {
2676
2676
  newPlacement = newPlacement.replace('top', 'bottom');
2677
2677
  }
2678
- if (availableSpace.left < 0 && availableSpace.right > 0) {
2678
+ if (availableSpace.left < 0 && (availableSpace.right > 0 || availableSpace.right < popupRect.width)) {
2679
2679
  newPlacement = newPlacement.replace('Right', 'Left');
2680
2680
  }
2681
- if (availableSpace.right < 0 && availableSpace.left > 0) {
2681
+ if (availableSpace.right < 0 && (availableSpace.left > 0 || availableSpace.left < popupRect.width)) {
2682
2682
  newPlacement = newPlacement.replace('Left', 'Right');
2683
2683
  }
2684
2684
  if (availableSpace.right < 0 && availableSpace.left < 0) {
@@ -2689,10 +2689,6 @@ const usePopupPosition = ({
2689
2689
  positions.left = positions.left - popupRef.current.clientWidth + container.width;
2690
2690
  }
2691
2691
  }
2692
- console.log({
2693
- newPlacement,
2694
- availableSpace
2695
- });
2696
2692
  _setPlacement(newPlacement);
2697
2693
  }
2698
2694
  const _calculation = () => {