x-ui-design 0.7.62 → 0.7.63

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
@@ -1982,9 +1982,9 @@ const usePossition = ({
1982
1982
  const spaceAbove = inputRect.top - containerRect.top;
1983
1983
  const spaceBelow = containerRect.bottom - inputRect.bottom;
1984
1984
  const shouldShowAbove = spaceBelow < dropdownHeight && spaceAbove > dropdownHeight;
1985
- const hasLeft = placement?.includes('Left');
1985
+ const hasRight = placement?.includes('Right');
1986
1986
  if (getPopupContainer) {
1987
- const leftPossition = hasLeft ? (containerRef.current?.getBoundingClientRect().left || 0) + (containerRef.current?.offsetWidth || 0) - (popupRef.current?.offsetWidth || 0) : (containerRef.current?.getBoundingClientRect().left || 0) + document.documentElement.scrollLeft;
1987
+ const leftPossition = hasRight ? (containerRef.current?.getBoundingClientRect().left || 0) + (containerRef.current?.offsetWidth || 0) - (popupRef.current?.offsetWidth || 0) : (containerRef.current?.getBoundingClientRect().left || 0) + document.documentElement.scrollLeft;
1988
1988
  if (shouldShowAbove) {
1989
1989
  setDropdownPosition({
1990
1990
  top: (containerRef.current?.getBoundingClientRect().top || 0) + document.documentElement.scrollTop - (popupRef.current?.offsetHeight || 0),
@@ -1999,7 +1999,7 @@ const usePossition = ({
1999
1999
  } else {
2000
2000
  setDropdownPosition({
2001
2001
  top: shouldShowAbove ? containerRef.current.offsetTop - (popupRef.current?.offsetHeight || dropdownHeight) - 8 : containerRef.current.offsetTop + containerRef.current.offsetHeight,
2002
- ...(hasLeft ? {
2002
+ ...(hasRight ? {
2003
2003
  left: containerRef.current.offsetLeft + (containerRef.current?.offsetWidth || 0) - (popupRef.current?.offsetWidth || 0)
2004
2004
  } : {
2005
2005
  left: containerRef.current.offsetLeft