mirror of
https://github.com/shoelace-style/shoelace.git
synced 2026-01-12 11:09:13 +00:00
change to getSlottedChildrenOutsideRootElement
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user