Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused code path #1539

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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