@sebgroup/green-core 3.21.1 → 3.21.2-rc.20260904080740058
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/components/popover/popover.component.js +19 -4
- package/custom-elements.json +130757 -130757
- package/gds-element.js +1 -1
- package/generated/mcp/components.json +1 -1
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/tokens.json +1 -1
- package/generated/react/index.d.ts +1 -1
- package/generated/react/index.js +1 -1
- package/package.json +1 -1
- package/setup-jest.js +2 -0
- package/utils/helpers/custom-element-scoping.js +1 -1
|
@@ -22,6 +22,10 @@ import { watch, watchMediaQuery } from "../../utils/decorators/index.js";
|
|
|
22
22
|
import { ariaForwarding } from "../../utils/decorators/aria-forwarding.js";
|
|
23
23
|
import { IconCrossSmall } from "../icon/icons/cross-small.component.js";
|
|
24
24
|
import PopoverStyles from "./popover.styles.js";
|
|
25
|
+
function roundByDPR(value) {
|
|
26
|
+
const dpr = window.devicePixelRatio || 1;
|
|
27
|
+
return Math.round(value * dpr) / dpr;
|
|
28
|
+
}
|
|
25
29
|
function applyTriggerAriaAttributes(trigger, open, popupRole) {
|
|
26
30
|
trigger.setAttribute("aria-expanded", String(open));
|
|
27
31
|
const focusableNodeNames = ["A", "BUTTON", "INPUT", "TEXTAREA"];
|
|
@@ -259,6 +263,9 @@ let GdsPopover = class extends GdsElement {
|
|
|
259
263
|
(_a = __privateGet(this, _autoPositionCleanupFn)) == null ? void 0 : _a.call(this);
|
|
260
264
|
this._elDialog?.style.removeProperty("left");
|
|
261
265
|
this._elDialog?.style.removeProperty("top");
|
|
266
|
+
this._elDialog?.style.removeProperty("right");
|
|
267
|
+
this._elDialog?.style.removeProperty("bottom");
|
|
268
|
+
this._elDialog?.style.removeProperty("transform");
|
|
262
269
|
this._elDialog?.style.removeProperty("minWidth");
|
|
263
270
|
this._elDialog?.style.removeProperty("min-width");
|
|
264
271
|
} else {
|
|
@@ -323,10 +330,18 @@ registerAutoPositioning_fn = function() {
|
|
|
323
330
|
middleware: this.floatingUIMiddleware,
|
|
324
331
|
strategy: "fixed"
|
|
325
332
|
}).then(
|
|
326
|
-
({ x, y }) =>
|
|
327
|
-
left
|
|
328
|
-
|
|
329
|
-
|
|
333
|
+
({ x, y }) => (
|
|
334
|
+
// Positioning via transform rather than left/top keeps the popover on its own
|
|
335
|
+
// compositing layer, which avoids a stale-paint bug in Safari when the placement
|
|
336
|
+
// flips while the popover is rendered outside the top layer (nonmodal mode).
|
|
337
|
+
Object.assign(floatingEl.style, {
|
|
338
|
+
left: "0",
|
|
339
|
+
top: "0",
|
|
340
|
+
right: "auto",
|
|
341
|
+
bottom: "auto",
|
|
342
|
+
transform: `translate3d(${roundByDPR(x)}px, ${roundByDPR(y)}px, 0)`
|
|
343
|
+
})
|
|
344
|
+
)
|
|
330
345
|
);
|
|
331
346
|
}));
|
|
332
347
|
};
|