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 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’