Skip to content

Commit

Permalink
[fixed] using concat for finding shadowRoot descendants instead of sp…
Browse files Browse the repository at this point in the history
…read

Co-authored-by: Bruno Dias <[email protected]>
  • Loading branch information
stevematney and diasbruno committed Nov 10, 2021
1 parent f5783ca commit 12ccd6a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/helpers/tabbable.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ export default function findTabbableDescendants(element) {
const descendants = [].slice
.call(element.querySelectorAll("*"), 0)
.reduce(
(finished, el) => [
...finished,
...(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot))
],
(finished, el) => finished.concat(
!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot)
),
[]
);
return descendants.filter(tabbable);
Expand Down

0 comments on commit 12ccd6a

Please sign in to comment.