Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

MudSelect ToStringFunc causes flicker

$
0
0

Adding

@* This returns the description of the selected item based on its id *@ToStringFunc="id => dataLoader.GetDescriptionFromList(brandModelsList, id)"

causes the MudSelect component to flicker when clicking on it to open or close. I guess it rerenders ? Is there any way I could get around that? Also, i use virtualization, because the items of the list are 1000+ as shown hereThis is the code:

<MudText Typo="Typo.subtitle1" GutterBottom="false">Brand Model</MudText><MudSelect T="int?" @bind-Value="customForm.SelectedBrandModelId"               Variant="Variant.Outlined"               Margin="Margin.Dense"               Dense="true"               PlaceHolder="Select"               ToStringFunc="id => dataLoader.GetDescriptionFromList(brandModelsList, id)">        @if (!brandModelsList.Any())        {<MudSelectItem T="int?" Value="null" Disabled="true">not found</MudSelectItem>        }        else        {<Virtualize Items="brandModelsList" Context="brandModel" ItemSize="36"><MudSelectItem T="int?" Value="@brandModel.ID" @key="brandModel.ID">@brandModel.Description</MudSelectItem></Virtualize>        }</MudSelect></div><ValidationMessage For="@(() => customForm.SelectedBrandModelId)" class="validation-error-message" />

I want want to reduce flicker when opening the component


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>