Repository navigation
Fix excessive wheel scrolling over hovered rows in Virtualize - #70658
Conversation
|
Thanks for your PR, @karmegams02. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
🟡 Changes recommended
The disposal test runs only after anchoring resumes, leaving immediate restoration of the saved overflow-anchor value and priority, along with deferred-frame cancellation, unverified during pending restoration.
1 open issue
What changed in this PR
Addresses #70541 by adjusting browser scroll anchoring in Blazor’s Virtualize component to prevent excessive wheel scrolling over hovered, unkeyed rows with asynchronous data loading.
Changes:
- Exposes loading state to JavaScript and delays anchoring restoration by two animation frames.
- Coordinates anchoring suppression across shared scroll containers and restores saved styles during disposal.
- Adds a controllable asynchronous test component and browser tests for hovered-row scrolling and disposal style preservation.
| File | Description |
|---|---|
src/Components/Web/src/Virtualization/Virtualize.cs |
Adds a loading-state attribute to the leading spacer. |
src/Components/Web.JS/src/Virtualize.ts |
Updates anchoring suppression, deferred restoration, shared-container tracking, and disposal cleanup. |
src/Components/test/testassets/BasicTestApp/VirtualizationHover.razor |
Adds hovered rows with pauseable loading and conditional removal. |
src/Components/test/testassets/BasicTestApp/Index.razor |
Registers the hovered-row test component. |
src/Components/test/E2ETest/Tests/VirtualizationTest.cs |
Adds wheel-scrolling and disposal style-preservation tests. |
Review effort: Balanced
|
/review |
kotlarmilos
left a comment
There was a problem hiding this comment.
LGTM! Please ensure to backport when merged by running /backport to release/11.0
|
/backport to release/11.0 |
|
Started backporting to |
|
✅ No documentation PR was created. Confidence that documentation is needed: 5% No docs needed: confident bug fix to Virtualize scroll anchoring with tests; no public or documented behavior change. Documentation surfaces considered
|

Description
Fixes excessive scrolling when using the mouse wheel over hovered, unkeyed
rows with an asynchronous items provider.
Fixes #70541
Root cause
Native browser scroll anchoring was restored before redistributed rows
completed layout. Asynchronous row updates could also arrive after anchoring
resumed. The browser then applied an additional scroll adjustment, causing
600px of wheel input to produce 904px of scrolling.
Fix
row updates, including when render batches arrive before Server interop.
Test
Added
HoveredRows_AsyncScrollDoesNotJump, using real wheel input and atest-controlled asynchronous provider.