Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TanStack/virtual
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.3
Choose a base ref
...
head repository: TanStack/virtual
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.4
Choose a head ref
  • 2 commits
  • 31 files changed
  • 2 contributors

Commits on Feb 2, 2024

  1. release: v3.0.3

    tannerlinsley committed Feb 2, 2024
    Copy the full SHA
    0f91fdf View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5bd44f6 View commit details
2 changes: 1 addition & 1 deletion examples/react/dynamic/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
},
"dependencies": {
"@faker-js/faker": "7.6.0",
"@tanstack/react-virtual": "3.0.2",
"@tanstack/react-virtual": "3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
2 changes: 1 addition & 1 deletion examples/react/fixed/package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"serve": "vite preview"
},
"dependencies": {
"@tanstack/react-virtual": "3.0.2",
"@tanstack/react-virtual": "3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
2 changes: 1 addition & 1 deletion examples/react/infinite-scroll/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@tanstack/react-virtual": "3.0.2",
"@tanstack/react-virtual": "3.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-query": "^3.39.1"
2 changes: 1 addition & 1 deletion examples/react/padding/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2",
"@tanstack/react-virtual": "3.0.2"
"@tanstack/react-virtual": "3.0.3"
},
"devDependencies": {
"@rollup/plugin-replace": "^4.0.0",
2 changes: 1 addition & 1 deletion examples/react/scroll-padding/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
},
"dependencies": {
"@react-hookz/web": "^14.2.2",
"@tanstack/react-virtual": "3.0.2",
"@tanstack/react-virtual": "3.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
2 changes: 1 addition & 1 deletion examples/react/smooth-scroll/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2",
"@tanstack/react-virtual": "3.0.2"
"@tanstack/react-virtual": "3.0.3"
},
"devDependencies": {
"@rollup/plugin-replace": "^4.0.0",
2 changes: 1 addition & 1 deletion examples/react/sticky/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
},
"dependencies": {
"@faker-js/faker": "^7.1.0",
"@tanstack/react-virtual": "3.0.2",
"@tanstack/react-virtual": "3.0.3",
"lodash": "^4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2"
2 changes: 1 addition & 1 deletion examples/react/table/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"dependencies": {
"@faker-js/faker": "7.6.0",
"@tanstack/react-table": "^8.7.9",
"@tanstack/react-virtual": "3.0.2",
"@tanstack/react-virtual": "3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
2 changes: 1 addition & 1 deletion examples/react/variable/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2",
"@tanstack/react-virtual": "3.0.2"
"@tanstack/react-virtual": "3.0.3"
},
"devDependencies": {
"@rollup/plugin-replace": "^4.0.0",
2 changes: 1 addition & 1 deletion examples/react/window/package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"serve": "vite preview"
},
"dependencies": {
"@tanstack/react-virtual": "3.0.2",
"@tanstack/react-virtual": "3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
2 changes: 1 addition & 1 deletion examples/svelte/dynamic/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
},
"dependencies": {
"@faker-js/faker": "^7.6.0",
"@tanstack/svelte-virtual": "3.0.2"
"@tanstack/svelte-virtual": "3.0.3"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.2",
2 changes: 1 addition & 1 deletion examples/svelte/fixed/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"dependencies": {
"@tanstack/svelte-virtual": "3.0.2"
"@tanstack/svelte-virtual": "3.0.3"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.2",
2 changes: 1 addition & 1 deletion examples/svelte/infinite-scroll/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
},
"dependencies": {
"@tanstack/svelte-query": "^5.8.2",
"@tanstack/svelte-virtual": "3.0.2"
"@tanstack/svelte-virtual": "3.0.3"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.2",
2 changes: 1 addition & 1 deletion examples/svelte/smooth-scroll/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
},
"dependencies": {
"@faker-js/faker": "^7.1.0",
"@tanstack/svelte-virtual": "3.0.2",
"@tanstack/svelte-virtual": "3.0.3",
"lodash": "^4.17.21"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion examples/svelte/sticky/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"dependencies": {
"@tanstack/svelte-virtual": "3.0.2"
"@tanstack/svelte-virtual": "3.0.3"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.2",
2 changes: 1 addition & 1 deletion examples/svelte/table/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
},
"dependencies": {
"@tanstack/svelte-table": "^8.10.7",
"@tanstack/svelte-virtual": "3.0.2"
"@tanstack/svelte-virtual": "3.0.3"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.2",
2 changes: 1 addition & 1 deletion examples/vue/dynamic/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
},
"dependencies": {
"@faker-js/faker": "^7.6.0",
"@tanstack/vue-virtual": "3.0.2",
"@tanstack/vue-virtual": "3.0.3",
"vue": "^3.3.4"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion examples/vue/fixed/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/vue-virtual": "3.0.2",
"@tanstack/vue-virtual": "3.0.3",
"vue": "^3.3.4"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion examples/vue/infinite-scroll/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
},
"dependencies": {
"@tanstack/vue-query": "^4.37.0",
"@tanstack/vue-virtual": "3.0.2",
"@tanstack/vue-virtual": "3.0.3",
"vue": "^3.3.4"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion examples/vue/padding/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/vue-virtual": "3.0.2",
"@tanstack/vue-virtual": "3.0.3",
"vue": "^3.3.4"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion examples/vue/scroll-padding/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/vue-virtual": "3.0.2",
"@tanstack/vue-virtual": "3.0.3",
"@vueuse/core": "^10.5.0",
"vue": "^3.3.4"
},
2 changes: 1 addition & 1 deletion examples/vue/smooth-scroll/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/vue-virtual": "3.0.2",
"@tanstack/vue-virtual": "3.0.3",
"vue": "^3.3.4"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion examples/vue/sticky/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
},
"dependencies": {
"@faker-js/faker": "^7.6.0",
"@tanstack/vue-virtual": "3.0.2",
"@tanstack/vue-virtual": "3.0.3",
"lodash": "^4.17.21",
"vue": "^3.3.4"
},
2 changes: 1 addition & 1 deletion examples/vue/table/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"dependencies": {
"@faker-js/faker": "^7.6.0",
"@tanstack/vue-table": "^8.10.7",
"@tanstack/vue-virtual": "3.0.2",
"@tanstack/vue-virtual": "3.0.3",
"vue": "^3.3.4"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion examples/vue/variable/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/vue-virtual": "3.0.2",
"@tanstack/vue-virtual": "3.0.3",
"vue": "^3.3.4"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/react-virtual/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/react-virtual",
"author": "Tanner Linsley",
"version": "3.0.2",
"version": "3.0.3",
"description": "Headless UI for virtualizing scrollable elements in React",
"license": "MIT",
"homepage": "https://github.com/tanstack/virtual#readme",
2 changes: 1 addition & 1 deletion packages/solid-virtual/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/solid-virtual",
"author": "Tanner Linsley",
"version": "3.0.2",
"version": "3.0.3",
"description": "Headless UI for virtualizing scrollable elements in Solid",
"license": "MIT",
"homepage": "https://github.com/tanstack/virtual#readme",
2 changes: 1 addition & 1 deletion packages/svelte-virtual/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/svelte-virtual",
"author": "Tanner Linsley",
"version": "3.0.2",
"version": "3.0.3",
"description": "Headless UI for virtualizing scrollable elements in Svelte",
"license": "MIT",
"homepage": "https://github.com/tanstack/virtual#readme",
2 changes: 1 addition & 1 deletion packages/virtual-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/virtual-core",
"author": "Tanner Linsley",
"version": "3.0.2",
"version": "3.0.3",
"description": "Headless UI for virtualizing scrollable elements in TS/JS + Frameworks",
"license": "MIT",
"homepage": "https://github.com/tanstack/virtual#readme",
19 changes: 16 additions & 3 deletions packages/virtual-core/src/index.ts
Original file line number Diff line number Diff line change
@@ -867,11 +867,24 @@ export class Virtualizer<
})
}

getTotalSize = () =>
(this.getMeasurements()[this.options.count - 1]?.end ||
this.options.paddingStart) -
getTotalSize = () => {
const measurements = this.getMeasurements();

let end: number;
// If there are no measurements, set the end to paddingStart
if (measurements.length === 0) {
end = this.options.paddingStart;
} else {
// If lanes is 1, use the last measurement's end, otherwise find the maximum end value among all measurements
end = this.options.lanes === 1
? (measurements[measurements.length - 1]?.end ?? 0)
: Math.max(...measurements.slice(-this.options.lanes).map((m) => m.end));
}

return end -
this.options.scrollMargin +
this.options.paddingEnd
}

private _scrollToOffset = (
offset: number,
2 changes: 1 addition & 1 deletion packages/vue-virtual/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/vue-virtual",
"author": "Tanner Linsley",
"version": "3.0.2",
"version": "3.0.3",
"description": "Headless UI for virtualizing scrollable elements in Vue",
"license": "MIT",
"homepage": "https://github.com/tanstack/virtual#readme",