fix: TS2532 undefined check in controller nav Enter handler
Some checks failed
Build Archipelago ISO / build-iso (push) Failing after 17m29s
Some checks failed
Build Archipelago ISO / build-iso (push) Failing after 17m29s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -155,9 +155,10 @@ export function useControllerNav(containerRef?: { value: HTMLElement | null }) {
|
||||
const root = containerRef?.value ?? document
|
||||
const all = getFocusableElements(root)
|
||||
const idx = all.indexOf(target as HTMLElement)
|
||||
if (idx >= 0 && idx < all.length - 1) {
|
||||
all[idx + 1].focus()
|
||||
all[idx + 1].scrollIntoView({ block: 'nearest', behavior: 'smooth' })
|
||||
const next = idx >= 0 ? all[idx + 1] : undefined
|
||||
if (next) {
|
||||
next.focus()
|
||||
next.scrollIntoView({ block: 'nearest', behavior: 'smooth' })
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user