@sanity/ui 2.8.24 → 2.8.26

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.mjs CHANGED
@@ -3951,14 +3951,14 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
3951
3951
  refs.setReference(node_0);
3952
3952
  const childRef = getElementRef(childProp);
3953
3953
  typeof childRef == "function" ? childRef(node_0) : childRef && (childRef.current = node_0);
3954
- }, [childProp, refs]), child = useMemo(() => !childProp || referenceElement ? null : cloneElement(childProp, {
3954
+ }, [childProp, refs]), child = useMemo(() => referenceElement ? childProp : childProp ? cloneElement(childProp, {
3955
3955
  ref: setReference
3956
- }), [childProp, referenceElement, setReference]);
3956
+ }) : null, [childProp, referenceElement, setReference]);
3957
3957
  if (useEffect(() => {
3958
3958
  updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
3959
3959
  }, [update, updateRef]), useEffect(() => {
3960
- child || refs.setReference(referenceElement || null);
3961
- }, [referenceElement, refs, child]), disabled)
3960
+ referenceElement && refs.setReference(referenceElement);
3961
+ }, [referenceElement, refs]), disabled)
3962
3962
  return childProp || /* @__PURE__ */ jsx(Fragment, {});
3963
3963
  const popover = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, tone, width: matchReferenceWidth ? referenceWidthRef.current : width, x, y, children: content }) }), children = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
3964
3964
  return /* @__PURE__ */ jsxs(Fragment, { children: [