You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: Loading value is now ignored in DataGrid when there is an item provider #2998
There has been a regression in fluentui-blazor's DataGrid component recently (first noticed in microsoft/aspire#6834) - Loading works as expected when the Items parameter is provided. However, if instead you set ItemsProvider, if no items are returned in the item provider EmptyContent will be rendered even if Loading is set to true
💻 Repro or Code Sample
<divstyle="height: 434px; overflow:auto;"tabindex="-1">
<FluentDataGridstyle="height: 100%;"Loading="true"ItemsProvider="@foodRecallProvider"Virtualize="true"ItemSize="46"GenerateHeader="GenerateHeaderOption.Sticky"TGridItem="string" >
<PropertyColumnTitle="ID"Property="@(c => c)" />
</FluentDataGrid>
</div>
<p>Total: <strong>@numResults results found</strong></p>
@code{GridItemsProvider<string> foodRecallProvider=default!;
int?numResults;
protectedoverrideasyncTaskOnInitializedAsync()
{foodRecallProvider=asyncreq=>
{
returnGridItemsProviderResult.From<string>(
items: [],
totalItemCount: 0);
};
// Display the number of results just for information. This is completely separate from the grid.numResults=1;
}}
🤔 Expected Behavior
If Loading is set to true, even if the items provider has returned successfully with 0 items, LoadingContent should be rendered instead of EmptyContent.
😯 Current Behavior
EmptyContent is rendered.
💁 Possible Solution
🔦 Context
🌍 Your Environment
OS & Device: [e.g. MacOS, iOS, Windows, Linux] on [iPhone 7, PC]
Browser [e.g. Microsoft Edge, Google Chrome, Apple Safari, Mozilla FireFox]
.NET and Fluent UI Blazor library Version [e.g. 8.0.2 and 4.4.1]
Activity