microsoft / fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications

Home Page:https://www.fluentui-blazor.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FluentAutocomplete SelectedOptionChanged not work

282030166 opened this issue · comments

commented

FluentAutocomplete SelectedOptionChanged not work

<FluentAutocomplete TOption="Country" AutoComplete="off" Autofocus="true" Label="Select a country" Width="250px" Placeholder="Select countries" OnOptionsSearch="@OnSearch" MaximumSelectedOptions="5" OptionText="@(item => item.name)" SelectedOptionChanged="ontest" />

`
@code {
public void ontest(Country c)
{
Console.WriteLine(c.name);

  }
}

`

The code above is not fully functional. Are you able to provide the code for the Country object and the OnSearch method? Or even better, provide a link to a repo that reproduces the issue?

You need to use the SelectedOptionsChanged event (with s) because the Autocomplete can select multiple items.
And so, as described in the documentation, "Called whenever the selection changed.. Only available if Multiple = false".

s

Document of that isn't competed and fully describe of that