Menu

Blazor Virtualize: a restore scroll should not consume the next scroll
📰

Blazor Virtualize: a restore scroll should not consume the next scroll

DEV Community: dotnet·Josue Barros·3 days ago
#B5IV4JeJ
#devtodotnet#devto#dev#scroll#rows
Long article (383 words) — no AI summary yet.
Reading 0:00
15s threshold

restoreAnchorForShift sets the scroll source to RestoreSnapshot. A later scripted scrollTop assignment or native scrollbar drag can be treated as ProgrammaticScroll, so the rendered window does not move and the viewport shows only spacer.

This is one of the pull requests behind Six merged PRs in 72 hours . The series looks at the failure, the fix and the review evidence, one merge at a time.

The change: +132 / -14 across 5 files. PR 70630 .

The bug

That is a state-machine bug, not a layout bug. The DOM has the items, the virtualizer has a range, but the source of the scroll event is classified incorrectly, so the virtualizer ignores the correction that should bring the first rows back.

The reported case was a filtered 1,000-row list. Clearing the filter and clicking Back to top had to render the first rows, but the viewport could stay on empty space.

Why it mattered

Virtualization is a correctness feature: it decides which rows exist in the DOM.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.