Skip to content

[release/11.0] Avoid false positive prepend detection that causes backward scroll jumps- #69448 - #69466

Merged
wtgodbe merged 1 commit into
release/11.0-rc2from
backport/pr-69362-to-release/11.0
Sep 23, 2026
Merged

wtgodbe merged 1 commit into
release/11.0-rc2from
backport/pr-69362-to-release/11.0

Conversation

@ilonatommy

Copy link
Copy Markdown
Member

Backport of #69362 to release/11.0

/cc @ilonatommy

Avoid false positive prepend detection that causes backward scroll jumps

Description

Spotted in Aspire dashboard. This change fixes multiple related Virtualize issues when an asynchronous items provider changes while the user is scrolling:

  • Compare items at the same global index across provider windows, preventing ordinary scrolling and appends from being misclassified as prepends.
  • Preserve overlapping-window identity when scrolling moves past the previously rendered first item.
  • Prevent canceled refreshes from overwriting a newer committed provider window.
  • Reuse bounded prefetched rows for small prepends and End-tail appends while limiting prepend look-ahead to explicit data refreshes.
  • Track Start/top follow intent independently from End/bottom follow intent.
  • Restore table anchors during the matching DOM mutation so Server rendering does not expose a shifted frame.
  • Preserve anchor snapshots for layouts using native browser scroll anchoring.
  • Prevent Start-mode appends from racing an after-spacer callback and incorrectly pinning the viewport to the new tail.
  • Materialize custom-provider results once so lazy or single-pass sequences are not enumerated repeatedly.

Fixes #69380
Fixes #69381

Customer Impact

Applications using virtualized live data, including Aspire Dashboard and virtualized QuickGrid scenarios, can experience:

  • reverse-direction scroll jumps while new data arrives;
  • visible content moving or disappearing during prepends;
  • Start mode unexpectedly following appended tail items;
  • duplicate provider requests for the same update;
  • skipped or delayed materialization during continuous updates;
  • stale provider windows being displayed after cancellation;
  • failures with lazy or single-pass provider results.

The issues affect both Server and WebAssembly rendering and are most visible with delayed providers, continuously updating data, table virtualization, and fresh item instances returned from each provider call.

There is no complete application-level workaround. Applications can reduce some symptoms by avoiding continuous updates or virtualization, but cannot reliably prevent the provider-window and anchoring races.

Regression?

  • Yes
  • No

Net10 didn't have viewport stabilization at all so it is not a regression in comparison to the previous version.

Risk

  • High
  • Medium
  • Low

The changes affect internal Virtualize provider-window, anchoring, cancellation, and JavaScript observer behavior. There are no new public APIs or packaging changes. Risk is mitigated by targeted unit, browser, Server, WebAssembly, QuickGrid, table, fixed-height, and variable-height coverage.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

Copilot AI lite review requested due to automatic review settings September 23, 2026 16:42
@ilonatommy
ilonatommy requested review from a team and wtgodbe as code owners September 23, 2026 16:42
@ilonatommy ilonatommy self-assigned this Sep 23, 2026
@ilonatommy ilonatommy added area-blazor Includes: Blazor, Razor Components feature-blazor-virtualization This issue is related to the Blazor Virtualize component Servicing-consider Shiproom approval is required for the issue labels Sep 23, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hi @ilonatommy. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

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

🟡 Changes recommended

Resolve the unrelated toolchain updates and ensure canceled refreshes cannot apply stale JavaScript anchor restoration.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Backports virtualization provider-window, scrolling, cancellation, and anchor-restoration fixes to release/11.0, with expanded regression coverage.

Changes:

  • Improves prepend/append detection, prefetching, and provider-result handling.
  • Adds scroll-anchor and follow-mode fixes.
  • Expands virtualization, navigation, rendering, and table tests.
  • Updates release-branch SDK and dependency tooling.
File Description
src/​Shared/​E2ETesting/​BrowserFixture.cs Navigation prompt configuration
src/​Components/​Web/​test/​Virtualization/​VirtualizeTest.cs Unit regression coverage
src/​Components/​Web/​src/​Virtualization/​VirtualizeJsInterop.cs JavaScript interop updates
src/​Components/​Web/​src/​Virtualization/​Virtualize.cs Provider-window and anchoring logic
src/​Components/​Web.JS/​src/​Virtualize.ts Scroll tracking and anchor restoration
src/​Components/​test/​testassets/​BasicTestApp/​VirtualizationTableScrollWithAppend.razor Virtualization test scenario
src/​Components/​test/​testassets/​BasicTestApp/​Index.razor Test scenario registration
src/​Components/​test/​E2ETest/​Tests/​VirtualizationTest.cs Browser virtualization coverage
src/​Components/​test/​E2ETest/​Tests/​RoutingTest.cs Navigation prompt test updates
src/​Components/​test/​E2ETest/​ServerRenderingTests/​VirtualizationRenderModesTest.cs Provider-call expectation updates
src/​Components/​test/​E2ETest/​ServerExecutionTests/​NavigationLockPrerenderingTest.cs Prerendering navigation coverage
src/​Components/​QuickGrid/​Microsoft.AspNetCore.Components.QuickGrid/​src/​QuickGrid.razor.cs Comparer documentation
global.json SDK/toolset versions
eng/​Version.Details.xml Dependency versions
eng/​Version.Details.props Dependency properties
.config/​dotnet-tools.json Tool versions

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

Comment thread global.json Resolved

@wtgodbe wtgodbe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please undo changes to eng/Version.Details.*, dotnet-tools.json, and global.json

@ilonatommy
ilonatommy force-pushed the backport/pr-69362-to-release/11.0 branch from 57f35c3 to 4bb53e6 Compare September 23, 2026 17:08
@wtgodbe
wtgodbe merged commit fbb625b into release/11.0-rc2 Sep 23, 2026
37 checks passed
@wtgodbe wtgodbe added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Sep 23, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hi @ilonatommy. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components feature-blazor-virtualization This issue is related to the Blazor Virtualize component Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants