Skip to content

Commit

Permalink
remove unused code path (#1539)
Browse files Browse the repository at this point in the history
  • Loading branch information
KonnorRogers authored Aug 23, 2023
1 parent ae010c3 commit f30481e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/internal/tabbable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f30481e

Please sign in to comment.