From f61b098056f12cb7924457fb73630625cc57c3f3 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Fri, 13 Mar 2026 12:41:27 -0400 Subject: [PATCH 1/2] Add ShadowRoot to AnchorPositioningRoot type --- src/polyfill.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/polyfill.ts b/src/polyfill.ts index 88075a4..fc02c44 100644 --- a/src/polyfill.ts +++ b/src/polyfill.ts @@ -560,7 +560,7 @@ async function position(rules: AnchorPositions, useAnimationFrame = false) { } } -export type AnchorPositioningRoot = Document | HTMLElement; +export type AnchorPositioningRoot = Document | HTMLElement | ShadowRoot; export interface AnchorPositioningPolyfillOptions { // Whether to use `requestAnimationFrame()` when updating target elements’ From ac564f817caea7a854e9a89656018ca821ce0253 Mon Sep 17 00:00:00 2001 From: Jonny Gerig Meyer Date: Fri, 13 Mar 2026 13:04:50 -0400 Subject: [PATCH 2/2] update docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 477c22f..c1b7a2c 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ document will be implicitly polyfilled. ### roots -type: `(Document | HTMLElement)[]`, default: `[document]` +type: `(Document | HTMLElement | ShadowRoot)[]`, default: `[document]` By default the polyfill applies to `document`, but you can configure one or more shadow roots the polyfill should apply to using this option. See the