From 2ff9bbc7ed2788f02f6663349d836a9fa98c6cd5 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 18 Jul 2024 22:10:54 +0800 Subject: [PATCH] feat: undefined scrollIntoView --- src/renderer/src/modules/entry-column/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/modules/entry-column/index.tsx b/src/renderer/src/modules/entry-column/index.tsx index 2094e5e32..6abd7d5fb 100644 --- a/src/renderer/src/modules/entry-column/index.tsx +++ b/src/renderer/src/modules/entry-column/index.tsx @@ -61,7 +61,7 @@ export function EntryColumn() { const virtuosoRef = useRef(null) const entries = useEntriesByView({ onReset: useCallback(() => { - virtuosoRef.current?.scrollIntoView({ + virtuosoRef.current?.scrollIntoView?.({ index: 0, }) }, []), @@ -411,7 +411,7 @@ const EntryList: FC & { const nextIndex = Math.min(currentActiveEntryIndex + 1, data.length - 1) - virtuosoOptions.virtuosoRef.current?.scrollIntoView({ + virtuosoOptions.virtuosoRef.current?.scrollIntoView?.({ index: nextIndex, }) const nextId = data![nextIndex] @@ -435,7 +435,7 @@ const EntryList: FC & { data.length - 1 : Math.max(0, currentActiveEntryIndex - 1) - virtuosoOptions.virtuosoRef.current?.scrollIntoView({ + virtuosoOptions.virtuosoRef.current?.scrollIntoView?.({ index: nextIndex, }) const nextId = data![nextIndex]