Skip to content

Commit

Permalink
🆕 feat(InfiniteScroll): add the ResetStatus public method (#2110)
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem authored Aug 21, 2024
1 parent 3169bdc commit d7f2a1e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Masa.Blazor/Components/InfiniteScroll/MInfiniteScroll.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ private void ManualChangeCallback(bool val)
[MasaApiPublicMethod]
public async Task ResetAsync() => await DoLoadMore();

/// <summary>
/// Reset internal status to <see cref="InfiniteScrollLoadStatus.Ok"/>
/// </summary>
[MasaApiPublicMethod]
public void ResetStatus()
{
_loadStatus = InfiniteScrollLoadStatus.Ok;
StateHasChanged();
}

private void AddScrollListener()
{
if (!_firstRendered || _isAttached || string.IsNullOrWhiteSpace(Parent)) return;
Expand Down

0 comments on commit d7f2a1e

Please sign in to comment.