Skip to content

Commit

Permalink
Change to filter
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerJDev committed Aug 21, 2024
1 parent 9c89a27 commit 07e1664
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/focus-trap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ function observeFocusTrap(container: HTMLElement, sentinels: HTMLElement[]) {
const observer = new MutationObserver(mutations => {
for (const mutation of mutations) {
if (mutation.type === 'childList' && mutation.addedNodes.length) {
const sentinelChildren = Array.from(
mutation.addedNodes,
const sentinelChildren = Array.from(mutation.addedNodes).filter(
e => e instanceof HTMLElement && e.classList.contains('sentinel') && e.tagName === 'SPAN',
)

Expand Down

0 comments on commit 07e1664

Please sign in to comment.