fix(app): more defensive dom access

This commit is contained in:
Adam
2026-01-08 21:05:13 -06:00
parent 8a43c24934
commit 6da60bd5d9

View File

@@ -67,7 +67,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
if (!props.current) return
const key = props.key(props.current)
requestAnimationFrame(() => {
const element = scrollRef()!.querySelector(`[data-key="${key}"]`)
const element = scrollRef()?.querySelector(`[data-key="${key}"]`)
element?.scrollIntoView({ block: "center" })
})
})