From 340fc07a66bbcb6a84710f708a462ac004066452 Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Sun, 2 Feb 2025 09:06:30 +0330 Subject: [PATCH] improve Preload parameter implementation in BitInfiniteScrolling #9778 --- .../Components/InfiniteScrolling/BitInfiniteScrolling.razor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/InfiniteScrolling/BitInfiniteScrolling.razor.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/InfiniteScrolling/BitInfiniteScrolling.razor.cs index 76a0b33d6e..0677e8ddb0 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/InfiniteScrolling/BitInfiniteScrolling.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/InfiniteScrolling/BitInfiniteScrolling.razor.cs @@ -83,7 +83,8 @@ protected override async Task OnInitializedAsync() { if (Preload && ItemsProvider is not null) { - _currentItems.AddRange(await ItemsProvider(new(0, CancellationToken.None))); + var items = await ItemsProvider(new(0, CancellationToken.None)); + _currentItems.AddRange(items); } await base.OnInitializedAsync();