@tanstack/virtual-core 3.0.0-beta.61 → 3.0.0-beta.63
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.esm.js +4 -11
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +4 -11
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +4 -11
- package/build/lib/index.mjs.map +1 -1
- package/build/umd/index.development.js +4 -11
- 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 +11 -15
package/src/index.ts
CHANGED
|
@@ -587,13 +587,16 @@ export class Virtualizer<
|
|
|
587
587
|
this.calculateRange(),
|
|
588
588
|
this.options.overscan,
|
|
589
589
|
this.options.count,
|
|
590
|
+
this.getSize(),
|
|
590
591
|
],
|
|
591
|
-
(rangeExtractor, range, overscan, count) => {
|
|
592
|
-
return
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
592
|
+
(rangeExtractor, range, overscan, count, outerSize) => {
|
|
593
|
+
return outerSize === 0
|
|
594
|
+
? []
|
|
595
|
+
: rangeExtractor({
|
|
596
|
+
...range,
|
|
597
|
+
overscan,
|
|
598
|
+
count,
|
|
599
|
+
})
|
|
597
600
|
},
|
|
598
601
|
{
|
|
599
602
|
key: process.env.NODE_ENV !== 'production' && 'getIndexes',
|
|
@@ -620,7 +623,8 @@ export class Virtualizer<
|
|
|
620
623
|
entry: ResizeObserverEntry | undefined,
|
|
621
624
|
) => {
|
|
622
625
|
const item = this.measurementsCache[this.indexFromElement(node)]
|
|
623
|
-
|
|
626
|
+
|
|
627
|
+
if (!item || !node.isConnected) {
|
|
624
628
|
this.measureElementCache.forEach((cached, key) => {
|
|
625
629
|
if (cached === node) {
|
|
626
630
|
this.observer.unobserve(node)
|
|
@@ -632,14 +636,6 @@ export class Virtualizer<
|
|
|
632
636
|
|
|
633
637
|
const prevNode = this.measureElementCache.get(item.key)
|
|
634
638
|
|
|
635
|
-
if (!node.isConnected) {
|
|
636
|
-
if (prevNode) {
|
|
637
|
-
this.observer.unobserve(prevNode)
|
|
638
|
-
this.measureElementCache.delete(item.key)
|
|
639
|
-
}
|
|
640
|
-
return
|
|
641
|
-
}
|
|
642
|
-
|
|
643
639
|
if (prevNode !== node) {
|
|
644
640
|
if (prevNode) {
|
|
645
641
|
this.observer.unobserve(prevNode)
|