Skip to content

Commit 3bd66df

Browse files
Remove padding temporarily
1 parent 6ef9ec7 commit 3bd66df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/VirtualList.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script lang="ts">
22
import { onMount, tick } from 'svelte'
3-
import VirtualList from './VirtualList.svelte'
43
54
export let items: any[]
65
export let height = '100%'
@@ -9,7 +8,9 @@
98
let initialScrollPos = scrollPos
109
1110
// Number of additional elements out of view. Helps when scrolling fast.
12-
export let pad = 1
11+
// Note: This is currently broken - when the padded item doesn't have it's height
12+
// calculated (i.e. it is rendered at the end).
13+
export let pad = 0
1314
1415
let heightMap = new WeakMap<
1516
any,
@@ -85,6 +86,7 @@
8586
}
8687
8788
const info = heightMap.get(items[i])
89+
info.offset = y
8890
if (y <= top) {
8991
start = i
9092
}

0 commit comments

Comments
 (0)