Skip to content

Commit

Permalink
Add additional check
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerJDev committed Nov 7, 2024
1 parent 101fe01 commit 532a36f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/focus-trap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ export function focusTrap(

// If the container already has sentinels as direct children, don't add more.
// The mutation observer will take care of moving existing sentinels to the correct position.
const existingSentinels = Array.from(container.children).filter(e => e.classList.contains('sentinel'))
const existingSentinels = Array.from(container.children).filter(
e => e.classList.contains('sentinel') && e.tagName === 'SPAN',
)

if (!existingSentinels.length) {
container.prepend(sentinelStart)
Expand Down

0 comments on commit 532a36f

Please sign in to comment.