From 863f3ef3ef8dd0899d7e9a90a40123a597ab7522 Mon Sep 17 00:00:00 2001 From: konnorrogers Date: Fri, 1 Dec 2023 09:48:02 -0500 Subject: [PATCH] change to getSlottedChildrenOutsideRootElement --- src/internal/tabbable.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal/tabbable.ts b/src/internal/tabbable.ts index 064f8924..4b274d97 100644 --- a/src/internal/tabbable.ts +++ b/src/internal/tabbable.ts @@ -80,7 +80,7 @@ export function getTabbableBoundary(root: HTMLElement | ShadowRoot) { * However, there is an edge case when, if the `root` is wrapped by another shadow DOM, it won't grab the children. * This fixes that fun edge case. */ -function slotChildrenOutsideRootElement(slotElement: HTMLSlotElement, root: HTMLElement | ShadowRoot) { +function getSlottedChildrenOutsideRootElement(slotElement: HTMLSlotElement, root: HTMLElement | ShadowRoot) { return (slotElement.getRootNode({ composed: true }) as ShadowRoot | null)?.host !== root; } @@ -104,7 +104,7 @@ export function getTabbableElements(root: HTMLElement | ShadowRoot) { tabbableElements.push(el); } - if (el instanceof HTMLSlotElement && slotChildrenOutsideRootElement(el, root)) { + if (el instanceof HTMLSlotElement && getSlottedChildrenOutsideRootElement(el, root)) { el.assignedElements({ flatten: true }).forEach((assignedEl: HTMLElement) => { walk(assignedEl); });