@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.esm.js +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/primitives/popover/popover.tsx +6 -4
package/package.json
CHANGED
|
@@ -366,7 +366,10 @@ export const Popover = memo(
|
|
|
366
366
|
)
|
|
367
367
|
|
|
368
368
|
const child = useMemo(() => {
|
|
369
|
-
|
|
369
|
+
// If a reference element is defined, we don't need to clone the child
|
|
370
|
+
if (referenceElement) return childProp
|
|
371
|
+
|
|
372
|
+
if (!childProp) return null
|
|
370
373
|
|
|
371
374
|
return cloneElement(childProp, {ref: setReference})
|
|
372
375
|
}, [childProp, referenceElement, setReference])
|
|
@@ -382,9 +385,8 @@ export const Popover = memo(
|
|
|
382
385
|
}, [update, updateRef])
|
|
383
386
|
|
|
384
387
|
useEffect(() => {
|
|
385
|
-
if (
|
|
386
|
-
|
|
387
|
-
}, [referenceElement, refs, child])
|
|
388
|
+
if (referenceElement) refs.setReference(referenceElement)
|
|
389
|
+
}, [referenceElement, refs])
|
|
388
390
|
|
|
389
391
|
if (disabled) {
|
|
390
392
|
return childProp || <></>
|