Skip to content

Commit b6257bd

Browse files
author
Georg Perhofer
committed
cleanup
1 parent 4e8daef commit b6257bd

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/lib/VirtualScroll.svelte

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
import Item from "./Item.svelte"
44
import {createEventDispatcher, onDestroy, onMount} from "svelte"
55
6-
/**
7-
* Unique key for getting data from `data`
8-
* @type {string}
9-
*/
10-
export let key = "id"
116
/**
127
* Source for list
138
* @type {Array<any>}
@@ -198,9 +193,7 @@
198193
})
199194
200195
function getUniqueIdFromDataSources() {
201-
//return data.map((dataSource) => dataSource[key])
202196
return data.map((dataSource, i) => i)
203-
204197
}
205198
206199
function onItemResized(event) {
@@ -271,11 +264,10 @@
271264
</Item>
272265
{/if}
273266
<div style="padding: {paddingStyle}" class="virtual-scroll-wrapper">
274-
<!-- {#each displayItems as dataItem, dataIndex (dataItem[key])} -->
275267
{#each displayItems as dataItem, dataIndex}
276268
<Item
277269
on:resize={onItemResized}
278-
uniqueKey={dataItem[key]}
270+
uniqueKey={dataIndex}
279271
horizontal={isHorizontal}
280272
type="item">
281273
<slot data={dataItem} index={dataIndex} />

0 commit comments

Comments
 (0)