Search code examples
blazormudblazor

MudAutoComplete can only show 10 results?


I have at least a dozen items which should be populating my MudAutoComplete but I am only seeing the first 10 results. I found in the https://www.mudblazor.com/components/autocomplete#presentation-extras documentation where they explain how to define a <MoreItemsTemplate>. And they state that only the first ten items are shown but there is no mention of how to increase this value.

<MudItem xs="12" sm="3">
    <MudAutocomplete Value="TeamFilter" ValueChanged="OnTeamValueChanged" @ref="teamAutocomplete" T="Team" Label="Team" SearchFunc="@SearchTeam" ToStringFunc="@(e => e == null ? null : $"{e.Name}")" Class="mt-1" Variant="Variant.Outlined" Margin="Margin.Dense" AnchorOrigin="Origin.BottomCenter" Adornment="Adornment.End" AdornmentIcon="@Icons.Material.Filled.Search" AdornmentColor="Color.Primary" ProgressIndicatorColor="Color.Default" Dense="true" ResetValueOnEmptyText="true" CoerceText="true">
        <NoItemsTemplate>
            <MudText Align="Align.Center" Class="px-4 py-1">
                No teams found
            </MudText>
        </NoItemsTemplate>
    </MudAutocomplete>
</MudItem>

Solution

  • Within the component https://www.mudblazor.com/api/autocomplete#properties documentation I found that the attribute MaxItems has a default value of 10. To display all items MaxItems must be set to null.