Skip to content

Commit

Permalink
feat: undefined scrollIntoView
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jul 18, 2024
1 parent cbc07b4 commit 2ff9bbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/renderer/src/modules/entry-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function EntryColumn() {
const virtuosoRef = useRef<VirtuosoHandle>(null)
const entries = useEntriesByView({
onReset: useCallback(() => {
virtuosoRef.current?.scrollIntoView({
virtuosoRef.current?.scrollIntoView?.({
index: 0,
})
}, []),
Expand Down Expand Up @@ -411,7 +411,7 @@ const EntryList: FC<VirtuosoProps<string, unknown> & {

const nextIndex = Math.min(currentActiveEntryIndex + 1, data.length - 1)

virtuosoOptions.virtuosoRef.current?.scrollIntoView({
virtuosoOptions.virtuosoRef.current?.scrollIntoView?.({
index: nextIndex,
})
const nextId = data![nextIndex]
Expand All @@ -435,7 +435,7 @@ const EntryList: FC<VirtuosoProps<string, unknown> & {
data.length - 1 :
Math.max(0, currentActiveEntryIndex - 1)

virtuosoOptions.virtuosoRef.current?.scrollIntoView({
virtuosoOptions.virtuosoRef.current?.scrollIntoView?.({
index: nextIndex,
})
const nextId = data![nextIndex]
Expand Down

0 comments on commit 2ff9bbc

Please sign in to comment.