diff options
| -rw-r--r-- | packages/ui/src/components/list.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/ui/src/components/list.tsx b/packages/ui/src/components/list.tsx index 60161f6dc..1283b3023 100644 --- a/packages/ui/src/components/list.tsx +++ b/packages/ui/src/components/list.tsx @@ -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" }) }) }) |
