Clicked row indication stops working as soon as a callback is being invoked by RowClickEvent in MudBlazor table

While trying to implement and adapt this MudBlazor table example here: MudBlazor example: Click Event and display for selected Row, I invoke a callback from RowClickEvent:

private void RowClickEvent(TableRowClickEventArgs<DriveFile> _tableRowClickEventArgs)
    {
        // verify that the delegate associated with this event dispatcher is non-null
        if (OnDriveFileSelected.HasDelegate)
        {
            if (_tableRowClickEventArgs.Item != null) OnDriveFileSelected.InvokeAsync(_tableRowClickEventArgs.Item.Id);
        }
    }

as soon as OnDriveFileSelected.InvokeAsync is being called, the table doesn’t properly indicate the selected row any more. It’s supposed to change the background color of the selected row, but it only changes the row’s background color once I unselect the row by clicking it again.
Once OnDriveFileSelected.InvokeAsync is being removed, the background indicator works as expected.
The callback is being called, it’s the background color indication that doesn’t work.

Here’s my full code, excluding using statements:

<style>
    .selected {
        background-color: #1E88E5 !important;
    }
    .selected > td {
        color: white !important;
    }
    .selected > td .mud-input {
        color: white !important;
    }
</style>


<MudTable T="DriveFile" Items="@Elements"Dense="false" Hover="true" Bordered="false" Striped="true" FixedHeader="true"
          FixedFooter="true" RowClass="cursor-pointer"  Breakpoint="Breakpoint.Sm"
          OnRowClick="RowClickEvent"
          Filter="new Func<DriveFile, bool>(FilterFunc1)"
          RowClassFunc="@SelectedRowClassFunc"
          @bind-SelectedItem="selectedItem1"
          @ref="mudTable">
    <ToolBarContent>
        <!-- <MudText Typo="Typo.h6">DriveFiles</MudText> -->
        <MudSpacer />
        <MudTextField @bind-Value="searchString1" Placeholder="Search" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Search" IconSize="Size.Medium" Class="mt-0"></MudTextField>
    </ToolBarContent>
    <HeaderContent>
        <MudTh>File Name</MudTh>
        <MudTh>File Size</MudTh>
        <MudTh>Upload Date</MudTh>
    </HeaderContent>
    <RowTemplate>
        <MudTd DataLabel="FileName">@context.FileName</MudTd>
        <MudTd DataLabel="FileSize">@context.FileSize</MudTd>
        <MudTd DataLabel="UploadTimestamp">@context.UploadTimestamp</MudTd>
    </RowTemplate>
</MudTable>


@code {
    
        
    [Parameter]
    public EventCallback<Guid> OnDriveFileSelected { get; set; } 
    
    [Parameter]
    public string FolderOrLabelToRetrieve { get; set; }
    
    private DriveFile selectedItem1 = null;
    private string searchString1 = "";
    private bool FilterFunc1(DriveFile _DriveFile) => FilterFunc(_DriveFile, searchString1);

    private bool FilterFunc(DriveFile _DriveFile, string searchString)
    {
        if (string.IsNullOrWhiteSpace(searchString)) return true;
        
        
        if (_DriveFile.FileName.Contains(searchString, StringComparison.OrdinalIgnoreCase))
            return true;
        
        return false;
    }
    
    
    
    private int selectedRowNumber = -1;
    private MudTable<DriveFile> mudTable;
    private List<string> clickedEvents = new();
    private IEnumerable<DriveFile> Elements;

    protected override Task OnInitializedAsync()
    {
        Elements = DatabaseAbstractionLayer.GetLabelOrFolderDriveFiles("Files").ToList();
        return base.OnInitializedAsync();
    }

    private void RowClickEvent(TableRowClickEventArgs<DriveFile> _tableRowClickEventArgs)
    {
        // verify that the delegate associated with this event dispatcher is non-null
        if (OnDriveFileSelected.HasDelegate)
        {
            // if (_tableRowClickEventArgs.Item != null) OnDriveFileSelected.InvokeAsync(_tableRowClickEventArgs.Item.Id);
        }
    }

    private string SelectedRowClassFunc(DriveFile element, int rowNumber)
    {
        if (selectedRowNumber == rowNumber)
        {
            selectedRowNumber = -1;
            clickedEvents.Add("Selected Row: None");
            return string.Empty;
        }
        else if (mudTable.SelectedItem != null && mudTable.SelectedItem.Equals(element))
        {
            selectedRowNumber = rowNumber;
            clickedEvents.Add($"Selected Row: {rowNumber}");
            return "selected";
        }
        else
        {
            return string.Empty;
        }
    }

Since I’m using the table in a reusable component and other components need to react to the user selecting a row, I’d like this callback to work.

Changing RowClickEvent to an async method or async Task and awaiting or not awaiting the result of OnDriveFileSelected.InvokeAsync(_tableRowClickEventArgs.Item.Id); doesn’t get the row indication to work.

Would anybody please know how I can get both the callback and the color indication to work?
Thank you so much!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật