@sanity/ui 2.0.0 → 2.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "sideEffects": false,
5
5
  "types": "./dist/index.d.ts",
6
6
  "source": "./exports/index.ts",
@@ -98,6 +98,10 @@ export interface PopoverProps
98
98
  portal?: boolean | string
99
99
  preventOverflow?: boolean
100
100
  referenceBoundary?: HTMLElement | null
101
+ /**
102
+ * When defined, the popover will be positioned relative to this element.
103
+ * The children of the popover won't be rendered.
104
+ */
101
105
  referenceElement?: HTMLElement | null
102
106
  scheme?: ThemeColorSchemeKey
103
107
  tone?: CardTone
@@ -376,8 +380,9 @@ export const Popover = memo(
376
380
  }, [update, updateRef])
377
381
 
378
382
  useEffect(() => {
383
+ if (child) return
379
384
  refs.setReference(referenceElement || null)
380
- }, [referenceElement, refs])
385
+ }, [referenceElement, refs, child])
381
386
 
382
387
  if (disabled) {
383
388
  return childProp || <></>