Skip to content

Conversation

@github-actions
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@tanstack/angular-virtual@4.0.2

Patch Changes

  • Updated dependencies [6d9274c]:
    • @tanstack/virtual-core@3.13.14

@tanstack/lit-virtual@3.13.15

Patch Changes

  • Updated dependencies [6d9274c]:
    • @tanstack/virtual-core@3.13.14

@tanstack/react-virtual@3.13.14

Patch Changes

  • Updated dependencies [6d9274c]:
    • @tanstack/virtual-core@3.13.14

@tanstack/solid-virtual@3.13.14

Patch Changes

  • Updated dependencies [6d9274c]:
    • @tanstack/virtual-core@3.13.14

@tanstack/svelte-virtual@3.13.14

Patch Changes

  • Updated dependencies [6d9274c]:
    • @tanstack/virtual-core@3.13.14

@tanstack/virtual-core@3.13.14

Patch Changes

  • Fix: Correct lane assignments when lane count changes dynamically (#1095)

    Fixed a critical bug where changing the number of lanes dynamically would cause layout breakage with incorrect lane assignments. When the lane count changed (e.g., from 3 to 2 columns in a responsive masonry layout), some virtual items would retain their old lane numbers, causing out-of-bounds errors and broken layouts.

    Root Cause: After clearing measurements cache on lane change, the virtualizer was incorrectly restoring data from initialMeasurementsCache, which contained stale lane assignments from the previous lane count.

    Fix: Skip initialMeasurementsCache restoration during lane transitions by checking the lanesSettling flag. This ensures all measurements are recalculated with correct lane assignments for the new lane count.

    Before:

    // With lanes = 2
    virtualItems.forEach((item) => {
      columns[item.lane].push(item) // ❌ Error: item.lane could be 3
    })

    After:

    // With lanes = 2
    virtualItems.forEach((item) => {
      columns[item.lane].push(item) // ✅ item.lane is always 0 or 1
    })

    This fix is essential for responsive masonry layouts where column count changes based on viewport width. No performance impact as it only affects the lane change transition path.

@tanstack/vue-virtual@3.13.14

Patch Changes

  • Updated dependencies [6d9274c]:
    • @tanstack/virtual-core@3.13.14

@piecyk piecyk merged commit a1d0043 into main Dec 30, 2025
@piecyk piecyk deleted the changeset-release/main branch December 30, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants