Skip to content

Commit e6e2ae0

Browse files
committed
style: add type guard to buttons
1 parent 014e98f commit e6e2ae0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ function focusKeydown(event: KeyboardEvent) {
292292
buttons[i].setAttribute('tabindex', i === n ? '0' : '-1')
293293
}
294294

295-
buttons[n].focus()
295+
if (buttons[n] instanceof HTMLElement) {
296+
buttons[n].focus()
297+
}
296298
}
297299

298300
const shortcutListeners = new WeakMap()

0 commit comments

Comments
 (0)