From 012206e4d877149c61b91d633b28b6af96960df8 Mon Sep 17 00:00:00 2001 From: Pavel Dymkov Date: Fri, 24 Jun 2022 15:37:38 +0300 Subject: [PATCH] Algorithm fix: fill "allElements" with only unique elements to improve performance. --- src/internal/tabbable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/tabbable.ts b/src/internal/tabbable.ts index 637abce27..163477d72 100644 --- a/src/internal/tabbable.ts +++ b/src/internal/tabbable.ts @@ -67,7 +67,7 @@ export function getTabbableBoundary(root: HTMLElement | ShadowRoot) { } } - [...el.querySelectorAll('*')].forEach((e: HTMLElement) => walk(e)); + [...el.children].forEach((e: HTMLElement) => walk(e)); } // Collect all elements including the root