Skip to content
This repository was archived by the owner on Sep 22, 2022. It is now read-only.

Commit da7d257

Browse files
committed
Remove a parent query and let visible do this check
1 parent 0ab41ba commit da7d257

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

index.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,7 @@ function keydown(event: KeyboardEvent): void {
3232
}
3333

3434
function focusable(el: Focusable): boolean {
35-
return (
36-
el.tabIndex >= 0 &&
37-
!el.disabled &&
38-
!el.hidden &&
39-
(!el.type || el.type !== 'hidden') &&
40-
!el.closest('[hidden]') &&
41-
visible(el)
42-
)
35+
return el.tabIndex >= 0 && !el.disabled && !el.hidden && (!el.type || el.type !== 'hidden') && visible(el)
4336
}
4437

4538
function visible(el): boolean {

0 commit comments

Comments
 (0)