@tanstack/virtual-core 3.0.1 → 3.0.3
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 -1
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +4 -1
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +4 -1
- package/build/lib/index.mjs.map +1 -1
- package/build/umd/index.development.js +4 -1
- 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 +10 -2
package/src/index.ts
CHANGED
|
@@ -503,7 +503,13 @@ export class Virtualizer<
|
|
|
503
503
|
|
|
504
504
|
return furthestMeasurements.size === this.options.lanes
|
|
505
505
|
? Array.from(furthestMeasurements.values()).sort(
|
|
506
|
-
(a, b) =>
|
|
506
|
+
(a, b) => {
|
|
507
|
+
if (a.end === b.end) {
|
|
508
|
+
return a.index - b.index;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
return a.end - b.end;
|
|
512
|
+
},
|
|
507
513
|
)[0]
|
|
508
514
|
: undefined
|
|
509
515
|
}
|
|
@@ -653,7 +659,9 @@ export class Virtualizer<
|
|
|
653
659
|
const delta = size - itemSize
|
|
654
660
|
|
|
655
661
|
if (delta !== 0) {
|
|
656
|
-
if (
|
|
662
|
+
if (
|
|
663
|
+
item.start < this.scrollOffset + this.scrollAdjustments
|
|
664
|
+
) {
|
|
657
665
|
if (process.env.NODE_ENV !== 'production' && this.options.debug) {
|
|
658
666
|
console.info('correction', delta)
|
|
659
667
|
}
|