@tanstack/virtual-core 3.19.7 → 3.19.8
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/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +9 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -2269,8 +2269,16 @@ export class Virtualizer<
|
|
|
2269
2269
|
}
|
|
2270
2270
|
|
|
2271
2271
|
private getVirtualDistanceFromEnd = () => {
|
|
2272
|
+
// `_getLayoutTotalSize()` measures the sizer, which starts `scrollMargin`
|
|
2273
|
+
// into the scroll content, while `getScrollOffset()` is measured from the
|
|
2274
|
+
// top of that content. Lift the total into the element's space before
|
|
2275
|
+
// subtracting, or the viewport reads `scrollMargin` px closer to the end
|
|
2276
|
+
// than it is and `getDistanceFromEnd()` disagrees by that much.
|
|
2272
2277
|
return Math.max(
|
|
2273
|
-
this._getLayoutTotalSize()
|
|
2278
|
+
this._getLayoutTotalSize() +
|
|
2279
|
+
this.options.scrollMargin -
|
|
2280
|
+
this.getSize() -
|
|
2281
|
+
this.getScrollOffset(),
|
|
2274
2282
|
0,
|
|
2275
2283
|
)
|
|
2276
2284
|
}
|