Skip to content

Commit bd00f61

Browse files
committed
Update virtual-scroller to v1.3.0
1 parent bb7129a commit bd00f61

File tree

3 files changed

+23
-17
lines changed

3 files changed

+23
-17
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,32 @@ export function VerticalList() {
6060

6161
## API
6262

63-
### `width = {0}`
63+
### `width = 0`
6464
Set the width of the VirtualScroller list.
6565

66-
### `height = {0}`
66+
### `height = 0`
6767
Set the height of the VirtualScroller list.
68-
#### `getItemLength = {(index: number) => number}`
68+
#### `getItemLength = (index: number) => number`
6969
Callback function to calculate and return the length(height or width) of each item by index.
7070

71-
### `offsetVisibleIndex = {0}`
71+
### `offsetVisibleIndex = 0`
7272
Number of extra items (overscan) to be rendered before/after the visible range.
7373

74-
### `virtualization = {'vertical'}`
74+
### `layout = 'vertical'`
7575
Set whether to use `vertical` or `horizontal` virtualization.
7676

77-
### `enableResizeObserver = {false}`
77+
### `enableResizeObserver = false`
7878
Set wether to update visible item indexes on element resize.
7979

80-
### `disableVirtualization = {false}`
80+
### `disableVirtualization = false`
8181
Set to disable virtualization (the `onVisibleRangeChange` callback will still be called).
8282

83+
### `resetOnIndex(index: number = 0, shouldUpdate: boolean = true): void`
84+
Rebuilds the items cached scrollOffset index on and after the specified index when called. Useful when the size of an item changes in your list, e.g. expanded/collapsed. By default calling this method will trigger an update, use `shouldUpdate` to override this behaviour.
85+
86+
### `scrollToItem(index: number): void`
87+
Scrolls to the specified item index when called. (The item aligns to the beginning of the list).
88+
8389
## Browser Support
8490
`<VirtualScroller>` supports `es2020` JavaScript features for desktop and
8591
mobile browsers and builds upon standard web platform APIs so that the performance,

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"access": "public"
2222
},
2323
"dependencies": {
24-
"@holmberd/virtual-scroller": "^1.2.1",
24+
"@holmberd/virtual-scroller": "^1.3.0",
2525
"prop-types": "^15.8.1"
2626
},
2727
"peerDependencies": {

0 commit comments

Comments
 (0)