fix(virtual-scroll): measure rendered items again after a data change - #2412
Merged
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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
deleted the
rkaraivanov/virtualization-data-change-sizes
branch
September 30, 2026 12:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Checklist
CHANGELOG.mdentry under[Unreleased]