From fdc01a263207e1af0d46d967a7eaeecd62a6ae23 Mon Sep 17 00:00:00 2001 From: konnorrogers Date: Wed, 23 Aug 2023 12:15:04 -0400 Subject: [PATCH] remove unused code path --- src/internal/tabbable.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/internal/tabbable.ts b/src/internal/tabbable.ts index 74ea7674..a9e11fa5 100644 --- a/src/internal/tabbable.ts +++ b/src/internal/tabbable.ts @@ -69,7 +69,6 @@ export function getTabbableBoundary(root: HTMLElement | ShadowRoot) { } export function getTabbableElements(root: HTMLElement | ShadowRoot) { - const allElements: HTMLElement[] = []; const tabbableElements: HTMLElement[] = []; function walk(el: HTMLElement | ShadowRoot) { @@ -79,10 +78,6 @@ export function getTabbableElements(root: HTMLElement | ShadowRoot) { return; } - if (!allElements.includes(el)) { - allElements.push(el); - } - if (!tabbableElements.includes(el) && isTabbable(el)) { tabbableElements.push(el); } @@ -116,7 +111,7 @@ export function getTabbableElements(root: HTMLElement | ShadowRoot) { // Is this worth having? Most sorts will always add increased overhead. And positive tabindexes shouldn't really be used. // So is it worth being right? Or fast? - // return allElements.filter(isTabbable).sort((a, b) => { + // return tabbableElements.filter(isTabbable).sort((a, b) => { // // Make sure we sort by tabindex. // const aTabindex = Number(a.getAttribute('tabindex')) || 0; // const bTabindex = Number(b.getAttribute('tabindex')) || 0;