x-ui-design 0.9.18 → 0.9.19

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
@@ -2640,15 +2640,6 @@ const usePopupPosition = ({
2640
2640
  relativePosition
2641
2641
  } = getElementParentDetails(targetRef.current, true);
2642
2642
  const _containsElement = scrollableParents?.contains(popupContainer) && popupContainer !== scrollableParents;
2643
- console.info({
2644
- container,
2645
- scrollableParents,
2646
- relativePosition,
2647
- positions: !popupContainer,
2648
- _containsElement,
2649
- inBody,
2650
- popupRef
2651
- });
2652
2643
  const positions = !popupContainer ? {
2653
2644
  top: (targetRef.current?.offsetTop || 0) + OFFSET,
2654
2645
  left: targetRef.current?.offsetLeft || 0
@@ -2694,10 +2685,10 @@ const usePopupPosition = ({
2694
2685
  }
2695
2686
  if (availableSpace.right < 0 && availableSpace.left < 0) {
2696
2687
  if (newPlacement.includes('Right')) {
2697
- positions.left = popupRef.current.clientWidth - positions.left + container.left;
2688
+ positions.left = popupRect.width - positions.left + container.left;
2698
2689
  }
2699
2690
  if (newPlacement.includes('Left')) {
2700
- positions.left = positions.left - popupRef.current.clientWidth + container.width;
2691
+ positions.left = positions.left - popupRect.width + container.width;
2701
2692
  }
2702
2693
  }
2703
2694
  _setPlacement(newPlacement);
@@ -2743,7 +2734,7 @@ const usePopupPosition = ({
2743
2734
  }
2744
2735
  };
2745
2736
  _calculation();
2746
- }, [targetRef, popupRef, popupContainer, inBody, _placement, setOpen]);
2737
+ }, [targetRef, popupRef.current, popupContainer, inBody, _placement, setOpen]);
2747
2738
  useEffect(() => {
2748
2739
  if (!open) {
2749
2740
  return;