fix: TS2532 undefined check in controller nav Enter handler
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:
Dorian
2026-03-26 21:29:14 +00:00
parent e4bdc775e4
commit 493a659ed4

View File

@@ -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
}