We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ef9ec7 commit 3bd66dfCopy full SHA for 3bd66df
src/components/VirtualList.svelte
@@ -1,6 +1,5 @@
1
<script lang="ts">
2
import { onMount, tick } from 'svelte'
3
- import VirtualList from './VirtualList.svelte'
4
5
export let items: any[]
6
export let height = '100%'
@@ -9,7 +8,9 @@
9
8
let initialScrollPos = scrollPos
10
11
// Number of additional elements out of view. Helps when scrolling fast.
12
- export let pad = 1
+ // Note: This is currently broken - when the padded item doesn't have it's height
+ // calculated (i.e. it is rendered at the end).
13
+ export let pad = 0
14
15
let heightMap = new WeakMap<
16
any,
@@ -85,6 +86,7 @@
85
86
}
87
88
const info = heightMap.get(items[i])
89
+ info.offset = y
90
if (y <= top) {
91
start = i
92
0 commit comments