@sanity/ui 2.8.25 → 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.js CHANGED
@@ -3945,14 +3945,14 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
3945
3945
  refs.setReference(node_0);
3946
3946
  const childRef = getElementRef(childProp);
3947
3947
  typeof childRef == "function" ? childRef(node_0) : childRef && (childRef.current = node_0);
3948
- }, [childProp, refs]), child = react.useMemo(() => !childProp || referenceElement ? null : react.cloneElement(childProp, {
3948
+ }, [childProp, refs]), child = react.useMemo(() => referenceElement ? childProp : childProp ? react.cloneElement(childProp, {
3949
3949
  ref: setReference
3950
- }), [childProp, referenceElement, setReference]);
3950
+ }) : null, [childProp, referenceElement, setReference]);
3951
3951
  if (react.useEffect(() => {
3952
3952
  updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
3953
3953
  }, [update, updateRef]), react.useEffect(() => {
3954
- child || refs.setReference(referenceElement || null);
3955
- }, [referenceElement, refs, child]), disabled)
3954
+ referenceElement && refs.setReference(referenceElement);
3955
+ }, [referenceElement, refs]), disabled)
3956
3956
  return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
3957
3957
  const popover = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
3958
3958
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [