@tanstack/virtual-core 3.0.0-beta.58 → 3.0.0-beta.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/index.d.ts +0 -1
- package/build/lib/index.esm.js +2 -3
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +2 -3
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +2 -3
- package/build/lib/index.mjs.map +1 -1
- package/build/umd/index.development.js +2 -3
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -5
package/src/index.ts
CHANGED
|
@@ -260,7 +260,6 @@ export interface VirtualizerOptions<
|
|
|
260
260
|
rangeExtractor?: (range: Range) => number[]
|
|
261
261
|
scrollMargin?: number
|
|
262
262
|
scrollingDelay?: number
|
|
263
|
-
elementKeyAttribute?: string
|
|
264
263
|
indexAttribute?: string
|
|
265
264
|
initialMeasurementsCache?: VirtualItem[]
|
|
266
265
|
lanes?: number
|
|
@@ -347,7 +346,6 @@ export class Virtualizer<
|
|
|
347
346
|
scrollMargin: 0,
|
|
348
347
|
scrollingDelay: 150,
|
|
349
348
|
indexAttribute: 'data-index',
|
|
350
|
-
elementKeyAttribute: 'data-element-key',
|
|
351
349
|
initialMeasurementsCache: [],
|
|
352
350
|
lanes: 1,
|
|
353
351
|
...opts,
|
|
@@ -623,9 +621,7 @@ export class Virtualizer<
|
|
|
623
621
|
) => {
|
|
624
622
|
const index = this.indexFromElement(node)
|
|
625
623
|
|
|
626
|
-
const elementKey =
|
|
627
|
-
node.getAttribute(this.options.elementKeyAttribute) ??
|
|
628
|
-
this.options.getItemKey(index)
|
|
624
|
+
const elementKey = this.options.getItemKey(index)
|
|
629
625
|
|
|
630
626
|
const prevNode = this.measureElementCache.get(elementKey)
|
|
631
627
|
|
|
@@ -653,6 +649,7 @@ export class Virtualizer<
|
|
|
653
649
|
resizeItem = (index: number, size: number) => {
|
|
654
650
|
const item = this.measurementsCache[index]
|
|
655
651
|
if (!item) {
|
|
652
|
+
console.warn(`Missing virtual item for index = ${index}`)
|
|
656
653
|
return
|
|
657
654
|
}
|
|
658
655
|
|