mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-24 17:44:49 +00:00
fix(app): more defensive dom access
This commit is contained in:
@@ -67,7 +67,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
|
|||||||
if (!props.current) return
|
if (!props.current) return
|
||||||
const key = props.key(props.current)
|
const key = props.key(props.current)
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
const element = scrollRef()!.querySelector(`[data-key="${key}"]`)
|
const element = scrollRef()?.querySelector(`[data-key="${key}"]`)
|
||||||
element?.scrollIntoView({ block: "center" })
|
element?.scrollIntoView({ block: "center" })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user