Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/api/virtualizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,14 @@ type getVirtualItems = () => VirtualItem[]

Returns the virtual items for the current state of the virtualizer.

### `getVirtualIndexes`

```tsx
type getVirtualIndexes = () => number[]
```

Returns the virtual row indexes for the current state of the virtualizer.

### `scrollToOffset`

```tsx
Expand Down
6 changes: 3 additions & 3 deletions packages/virtual-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ export class Virtualizer<
},
)

private getIndexes = memo(
getVirtualIndexes = memo(
() => {
let startIndex: number | null = null
let endIndex: number | null = null
Expand Down Expand Up @@ -724,7 +724,7 @@ export class Virtualizer<
})
},
{
key: process.env.NODE_ENV !== 'production' && 'getIndexes',
key: process.env.NODE_ENV !== 'production' && 'getVirtualIndexes',
debug: () => this.options.debug,
},
)
Expand Down Expand Up @@ -814,7 +814,7 @@ export class Virtualizer<
}

getVirtualItems = memo(
() => [this.getIndexes(), this.getMeasurements()],
() => [this.getVirtualIndexes(), this.getMeasurements()],
(indexes, measurements) => {
const virtualItems: Array<VirtualItem> = []

Expand Down