Repository navigation
[release/11.0-preview7] Fix Virtualize scroll jump from native/JS anchoring double-compensation - #67973
Merged
lewing merged 1 commit intoJul 23, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This backport addresses a Blazor Virtualize regression where native CSS scroll anchoring (overflow-anchor) could “fight” Virtualize’s own spacer-driven window sliding, causing sudden jumps to the start/end of long lists in Chromium/Firefox.
Changes:
- Introduces a reason-counted native anchoring suspend/resume mechanism in
Virtualize.tsto prevent double-compensation during spacer-triggered renders and convergence. - Threads
_loadingfromVirtualize(C#) into the JSrefreshObserverscall so native anchoring can be resumed at the correct phase for asyncItemsProviderrenders. - Adds/updates test assets and E2E coverage to reproduce and validate the non-jumping behavior and anchoring restoration.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Components/Web/src/Virtualization/VirtualizeJsInterop.cs | Extends JS interop to pass isLoading to refreshObservers. |
| src/Components/Web/src/Virtualization/Virtualize.cs | Forwards _loading into RefreshObserversAsync after render. |
| src/Components/Web.JS/src/Virtualize.ts | Implements native anchoring coordination (reason-counted suspend/resume) and refactors convergence tracking. |
| src/Components/test/testassets/BasicTestApp/VirtualizationComponent.razor | Adjusts the “incorrect size” fixture to make the regression more reproducible and adds data-index. |
| src/Components/test/E2ETest/Tests/VirtualizationTest.cs | Adds two new E2E tests and shared JS helpers for jump detection and render settling. |
ilonatommy
approved these changes
Jul 23, 2026
ilonatommy
temporarily deployed
to
copilot-pat-pool
July 23, 2026 12:06 — with
GitHub Actions
Inactive
ilonatommy
temporarily deployed
to
copilot-pat-pool
July 23, 2026 12:07 — with
GitHub Actions
Inactive
lewing
approved these changes
Jul 23, 2026
This branch was previously deployed
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.
[release/11.0-preview7] Fix Virtualize scroll jump from native/JS anchoring double-compensation
Backport of #67934 to release/11.0-preview7
Description
Virtualizein native scroll-anchoring mode (browsers that support CSSoverflow-anchor— i.e. not Safari, and not<table>layouts) could jump to the start or end of the list while the user scrolled. When a scroll brought a spacer into view,Virtualizeslid its render window (an intentional content shift) but the browser'soverflow-anchoralso tried to hold the contentstill. Both authorities compensated the same shift, the viewport overshot, and edge convergence latched it to the top or bottom.
This change makes native
overflow-anchorandVirtualize's own scroll handling cooperate so that exactly one authority acts per render, via a reason-countednativeAnchoring.suspend/resumehelper. All changes are confined to theuseNativeAnchoringcode paths; the manual JS compensation path used by Safari/WebKit and table layouts is unchanged.Fixes #67729
Customer Impact
Customers using the Blazor
Virtualizecomponent (includingQuickGrid) in Chromium/Firefox-based browsers see the list unexpectedly jump to the top or bottom during normal scrolling, making long lists effectively unusable. This is a visible functional regression introduced in preview.Regression?
Risk
Changes are scoped to the
useNativeAnchoringcode paths only; the non-native (Safari/table) compensation path is untouched. Covered by two new E2E tests plus the existing anchoring suite.Verification
Two E2E tests added to
VirtualizationTest.cs(ItemsIncrementalScroll_DoesNotJumpToStartOrEndandViewportAnchoring_RenderlessAboveViewportResize_AfterScroll_VisibleItemStaysInPlace).Packaging changes reviewed?