dotnet / dotnet/aspnetcore

Blazor Infinite Scrolling

Open
#33,429 4 comments 6 reactions 0 assignees View on GitHub
area-blazor enhancement feature-blazor-virtualization
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### The Problem

Sometimes it's costly to get total count if all items causing virtualized scrolling slow.
Othertimes it's a poor UX to have very long list (even virtualized)

### Scenarios

1. News feed, see the famous facebook wall.
2. Chat
3. Improving initial load of a datagrid

### Describe the solution you'd like

make the `totalItemsCount` parameter optional

```csharp
private async ValueTask> ProvideItems(ItemsProviderRequest request)
{
var page = Items.Skip(request.StartIndex).Take(request.Count);
await Task.Delay(200);
return new ItemsProviderResult(page);
}
```

New items would be requested each time user reaches end of the list

### Additional context

Might be related to #33426

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.