|
| 1 | +diff --git a/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs b/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs |
| 2 | +index dd4e77f..127987e 100644 |
| 3 | +--- a/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs |
| 4 | ++++ b/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs |
| 5 | +@@ -665,9 +665,9 @@ class Virtualizer { |
| 6 | + this.options.getItemKey(index) |
| 7 | + ); |
| 8 | + if (elementInDOM) { |
| 9 | +- const [latestOffset] = utils.notUndefined( |
| 10 | +- this.getOffsetForIndex(index, align) |
| 11 | +- ); |
| 12 | ++ const result = this.getOffsetForIndex(index, align) |
| 13 | ++ if (!result) return |
| 14 | ++ const [latestOffset] = result |
| 15 | + if (!utils.approxEqual(latestOffset, this.getScrollOffset())) { |
| 16 | + this.scrollToIndex(index, { align, behavior }); |
| 17 | + } |
| 18 | +diff --git a/node_modules/@tanstack/virtual-core/dist/esm/index.js b/node_modules/@tanstack/virtual-core/dist/esm/index.js |
| 19 | +index 8da519d..8c78af8 100644 |
| 20 | +--- a/node_modules/@tanstack/virtual-core/dist/esm/index.js |
| 21 | ++++ b/node_modules/@tanstack/virtual-core/dist/esm/index.js |
| 22 | +@@ -663,9 +663,9 @@ class Virtualizer { |
| 23 | + this.options.getItemKey(index) |
| 24 | + ); |
| 25 | + if (elementInDOM) { |
| 26 | +- const [latestOffset] = notUndefined( |
| 27 | +- this.getOffsetForIndex(index, align) |
| 28 | +- ); |
| 29 | ++ const result = this.getOffsetForIndex(index, align) |
| 30 | ++ if (!result) return |
| 31 | ++ const [latestOffset] = result |
| 32 | + if (!approxEqual(latestOffset, this.getScrollOffset())) { |
| 33 | + this.scrollToIndex(index, { align, behavior }); |
| 34 | + } |
| 35 | +diff --git a/node_modules/@tanstack/virtual-core/src/index.ts b/node_modules/@tanstack/virtual-core/src/index.ts |
| 36 | +index 3a0c446..4a9e792 100644 |
| 37 | +--- a/node_modules/@tanstack/virtual-core/src/index.ts |
| 38 | ++++ b/node_modules/@tanstack/virtual-core/src/index.ts |
| 39 | +@@ -1003,9 +1003,9 @@ export class Virtualizer< |
| 40 | + ) |
| 41 | + |
| 42 | + if (elementInDOM) { |
| 43 | +- const [latestOffset] = notUndefined( |
| 44 | +- this.getOffsetForIndex(index, align), |
| 45 | +- ) |
| 46 | ++ const result = this.getOffsetForIndex(index, align) |
| 47 | ++ if (!result) return |
| 48 | ++ const [latestOffset] = result |
| 49 | + |
| 50 | + if (!approxEqual(latestOffset, this.getScrollOffset())) { |
| 51 | + this.scrollToIndex(index, { align, behavior }) |
0 commit comments