From 86f8f4d58efc3f27da48db4b1bbaf2d1812228fc Mon Sep 17 00:00:00 2001 From: Ruben L Date: Sat, 23 Jan 2021 01:10:54 +0100 Subject: [PATCH] cleanup --- VirtualList.svelte | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/VirtualList.svelte b/VirtualList.svelte index 8c36ff4..6cd8f1a 100644 --- a/VirtualList.svelte +++ b/VirtualList.svelte @@ -5,9 +5,6 @@ export let items; export let height = '100%'; export let itemHeight = undefined; - - let foo; - // read-only, but visible to consumers via bind:start export let start = 0; export let end = 0; @@ -109,25 +106,6 @@ while (i < items.length) height_map[i++] = average_height; bottom = remaining * average_height; - // prevent jumping if we scrolled up into unknown territory - return - if (start < old_start) { - await tick(); - - let expected_height = 0; - let actual_height = 0; - - for (let i = start; i < old_start; i +=1) { - if (rows[i - start]) { - expected_height += height_map[i]; - actual_height += itemHeight || rows[i - start].offsetHeight; - } - } - - const d = actual_height - expected_height; - viewport.scrollTo(0, scrollTop + d); - } - // TODO if we overestimated the space these // rows would occupy we may need to add some // more. maybe we can just call handle_scroll again?