Repository navigation
[release/11.0-preview7] Virtualize tests with ItemProvider should always contain a delay - #68036
Merged
akoeplinger merged 1 commit intoJul 27, 2026
Conversation
…otnet#67959) * All ItemProvider tests should use delay to reproduce real life scenario. * Make failures of `AnchorMode_VariableHeight_EndKeyFromTop_JumpsToBottom deterministic - wait for the placeholders to transform to real items, only then scroll down and check if the initial landing was at the bottom or bumped up. * Fix Virtualize End-key not converging to true bottom in None/Start anchor modes. * Fix Virtualize End-mode Home key not converging to top after async re-render * Fix race in AnchorMode_WindowScroll_None_LargeAppendAtBottom_DoesNotFollowToBottom * Native anchoring has one blind spot: topmost scroll position (https://www.w3.org/TR/css-scroll-anchoring-1/). We have to use manual anchoring then. * When we don't have container (document/window scroll scenarios) then native scroll works fine.
ilonatommy
marked this pull request as ready for review
July 27, 2026 11:30
Contributor
There was a problem hiding this comment.
Pull request overview
This backport aligns Virtualize/QuickGrid virtualization coverage with real-world async ItemsProvider behavior by ensuring tests consistently exercise providers with a real delay, and it includes a small Virtualize.ts anchoring update to address issues exposed by that delayed-provider coverage.
Changes:
- Updated
Virtualize.tsscroll anchoring/follow logic to correctly handle delayed provider placeholder→real-item transitions (including Home/End key behavior and top-of-scroll manual anchoring for element scrollers). - Updated E2E tests and test assets to consistently enable provider delay when exercising
ItemsProviderscenarios, including new coverage for the reported delayed-provider bugs. - Added/extended test UI toggles and query parameters to enable provider delay in repro/test components.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Components/Web.JS/src/Virtualize.ts | Adjusts bottom-follow state handling and anchor snapshot behavior to fix delayed-provider anchoring edge cases. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Virtualization/VirtualizeAppendRepro.razor | Adds a delay query parameter to control provider delay in the server rendering repro page. |
| src/Components/test/testassets/BasicTestApp/VirtualizationAnchorModeWindowScroll.razor | Adds a UI toggle to simulate delayed ItemsProvider behavior for window-scroll anchor mode coverage. |
| src/Components/test/testassets/BasicTestApp/VirtualizationAnchorMode.razor | Updates delay status messaging to match the new test expectations. |
| src/Components/test/testassets/BasicTestApp/QuickGridTest/QuickGridVariableHeightComponent.razor | Adds a provider-delay toggle and status text to exercise delayed-provider QuickGrid variable-height scenarios. |
| src/Components/test/testassets/BasicTestApp/QuickGridTest/QuickGridScrollComponent.razor | Updates delay status messaging for consistency with revised E2E expectations. |
| src/Components/test/testassets/BasicTestApp/QuickGridTest/QuickGridAnchorModeComponent.razor | Updates UI/status text to clearly indicate QuickGrid provider delay state (consumed by tests). |
| src/Components/test/E2ETest/Tests/VirtualizationTest.cs | Enables provider delay by default for ItemsProvider-based virtualization test cases and adds new delayed-provider regression tests. |
| src/Components/test/E2ETest/ServerRenderingTests/VirtualizationRenderModesTest.cs | Navigates to the server-rendered repro with a non-zero delay to ensure coverage matches real provider latency. |
javiercn
approved these changes
Jul 27, 2026
Member
|
/ba-g build analysis is stuck but all AzDO builds are green |
akoeplinger
merged commit Jul 27, 2026
89467cb
into
dotnet:release/11.0-preview7
43 of 46 checks passed
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.
Backport of #67959 to
release/11.0-preview7Description
Real-life
ItemsProviderimplementations always come with some delay, soVirtualizeandQuickGridvirtualization tests that use a provider which merelyawait Task.Yield()do not reflect real usage. This change makes allAnchorMode/ScrollToItem/InitialItemIndextests added in net11 exercise the delayed-provider case consistently, and fixes the three product bugs that the delayed coverage revealed:AnchorMode_VariableHeight_EndKeyFromTop_JumpsToBottom- the re-pinning mechanism that handles a placeholder→real-item transition growingscrollHeightwas enabled only forEndanchor mode. It now applies to all modes, so an End-key jump lands and stays at the bottom once real (larger) items load.AnchorMode_End_HomeKeyFromBottom_JumpsToTop- inEndmode with a delayed provider,bottomTracking.reachedwas sticky-true and never reset, so a Home jump was pulled back to the bottom by auto-follow. Auto-follow is now disabled for all modes on a Home jump.AnchorMode_End_PrependAtTop_ViewportStaysStable- after Fix Virtualize scroll jump from native/JS anchoring double-compensation #67934 landed, native scroll anchoring is (by spec) suppressed atscrollTop = 0, so a prepend at the very top was not compensated and left the viewport blank. Manual anchoring is now applied for element scrollers at the top of scroll.Customer Impact
Blazor
VirtualizeandQuickGridmis-behave with real (delayed) async item providers in scenarios that were newly enabled in net11: an End-anchored Home-key jump snaps back to the bottom, a variable-height End-key jump bounces back up once real items load, and a prepend at the top of the list leaves the viewport blank. These are common patterns for data-bound grids backed by network calls. The fixes make anchoring behave correctly for delayed providers.Regression?
All affected code was introduced during the net11 preview cycle and has not shipped in a stable release. Bug 3 is an internal regression within net11 introduced by #67934 (also preview-only); it is corrected here.
Risk
The change is dominated by test additions (7 of 9 files). The single framework file (
Virtualize.ts, ~40 lines) narrowly scopes the anchoring re-pin / manual-anchor logic and is exercised by the expanded E2EAnchorModesuite, which passes.Verification
The full
ServerVirtualizationTest.AnchorModeE2E suite and the QuickGrid/Virtualizedelayed-provider tests pass locally.
Packaging changes reviewed?