@primer/react 0.0.0-20260424151836 → 0.0.0-20260424153709
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/CHANGELOG.md
CHANGED
|
@@ -52,7 +52,6 @@ const AnchoredOverlay = ({
|
|
|
52
52
|
}) => {
|
|
53
53
|
const cssAnchorPositioningFlag = useFeatureFlag('primer_react_css_anchor_positioning');
|
|
54
54
|
const supportsNativeCSSAnchorPositioning = useRef(false);
|
|
55
|
-
// eslint-disable-next-line react-hooks/refs
|
|
56
55
|
const cssAnchorPositioning = cssAnchorPositioningFlag && supportsNativeCSSAnchorPositioning.current;
|
|
57
56
|
// Only use Popover API when both CSS anchor positioning is enabled AND renderAs is true
|
|
58
57
|
const shouldRenderAsPopover = cssAnchorPositioning && renderAs === 'popover';
|
|
@@ -114,9 +113,7 @@ const AnchoredOverlay = ({
|
|
|
114
113
|
anchorOffset,
|
|
115
114
|
displayInViewport,
|
|
116
115
|
onPositionChange: positionChange
|
|
117
|
-
},
|
|
118
|
-
// eslint-disable-next-line react-hooks/refs
|
|
119
|
-
[overlayRef.current]);
|
|
116
|
+
}, [overlayRef.current]);
|
|
120
117
|
useEffect(() => {
|
|
121
118
|
supportsNativeCSSAnchorPositioning.current = 'anchorName' in document.documentElement.style;
|
|
122
119
|
|
|
@@ -167,6 +164,7 @@ const AnchoredOverlay = ({
|
|
|
167
164
|
}
|
|
168
165
|
return () => {
|
|
169
166
|
anchorElement.style.removeProperty('anchor-name');
|
|
167
|
+
// The overlay may no longer be in the DOM at this point, so we need to check for its presence before trying to update it.
|
|
170
168
|
if (currentOverlay) {
|
|
171
169
|
currentOverlay.style.removeProperty('position-anchor');
|
|
172
170
|
}
|
|
@@ -181,9 +179,7 @@ const AnchoredOverlay = ({
|
|
|
181
179
|
...restOverlayProps
|
|
182
180
|
} = overlayProps || {};
|
|
183
181
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
184
|
-
children: [renderAnchor &&
|
|
185
|
-
// eslint-disable-next-line react-hooks/refs
|
|
186
|
-
renderAnchor({
|
|
182
|
+
children: [renderAnchor && renderAnchor({
|
|
187
183
|
ref: anchorRef,
|
|
188
184
|
id: anchorId,
|
|
189
185
|
'aria-haspopup': 'true',
|
package/package.json
CHANGED