Skip to content

fix(virtual-scroll): measure rendered items again after a data change - #2412

Merged
rkaraivanov merged 1 commit into
masterfrom
rkaraivanov/virtualization-data-change-sizes
Sep 30, 2026
Merged

rkaraivanov merged 1 commit into
masterfrom
rkaraivanov/virtualization-data-change-sizes

Conversation

@rkaraivanov

Copy link
Copy Markdown
Member

Description

A data change discards the measurements from the first changed index, but a rendered wrapper that kept its index was not observed again. So, its size stayed at the estimate until it left the window. The wrappers from that index on are now observed again.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally
  • I have updated documentation if needed
  • I have added a CHANGELOG.md entry under [Unreleased]

A data change discards the measurements from the first changed index,
but a rendered wrapper that kept its index was not observed again. So
its size stayed at the estimate until it left the window. The wrappers
from that index on are now observed again.
Copilot AI balanced review requested due to automatic review settings September 30, 2026 11:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The fix depends on browser ResizeObserver delivery, which was not verified in this review.

Review effort: Balanced
Findings: None

What changed in this PR

This PR fixes virtual scroll measurements after a data change, so rendered items are measured again even when their wrappers keep the same index and size.

Changes:

  • Re-observes rendered items from the first changed index.
  • Adds regression tests and updates the component specification and changelog.
File Description
src/​components/​virtualization/​virtualization.ts Schedules affected wrappers for remeasurement.
src/​components/​virtualization/​virtualization.spec.ts Tests remeasurement after data changes.
src/​components/​virtualization/​spec.md Documents the measurement behavior.
CHANGELOG.md Records the bug fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rkaraivanov
rkaraivanov merged commit dbad1f3 into master Sep 30, 2026
8 checks passed
@rkaraivanov
rkaraivanov deleted the rkaraivanov/virtualization-data-change-sizes branch September 30, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants