@sanity/ui 2.8.9 → 2.8.10
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 +5 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/core/primitives/popover/popover.tsx +28 -2
package/dist/index.mjs
CHANGED
|
@@ -3449,7 +3449,7 @@ const Popover = memo(
|
|
|
3449
3449
|
), setReference = useCallback(
|
|
3450
3450
|
(node) => {
|
|
3451
3451
|
refs.setReference(node);
|
|
3452
|
-
const childRef = childProp
|
|
3452
|
+
const childRef = getElementRef(childProp);
|
|
3453
3453
|
typeof childRef == "function" ? childRef(node) : childRef && (childRef.current = node);
|
|
3454
3454
|
},
|
|
3455
3455
|
[childProp, refs]
|
|
@@ -3509,6 +3509,10 @@ const Popover = memo(
|
|
|
3509
3509
|
})
|
|
3510
3510
|
);
|
|
3511
3511
|
Popover.displayName = "Memo(ForwardRef(Popover))";
|
|
3512
|
+
function getElementRef(element) {
|
|
3513
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
3514
|
+
return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
|
|
3515
|
+
}
|
|
3512
3516
|
function radioBaseStyle() {
|
|
3513
3517
|
return css`
|
|
3514
3518
|
position: relative;
|