Closed sajrashid closed 2 years ago
Hi,
In multi-select mode, I'm unable to hit the ValueChanged event, if I remove @bind-Values the event triggers, but multi-select is removed, I don't know what am I doing wrong,?
ValueChanged
@bind-Values
Help appreciated, Thanks.
<BlazoredTypeahead class="bg-blue-500 text-gray-100" SearchMethod="GetRepos" @bind-Values="SelectedRepositories" Debounce="100" MaximumSuggestions="20" Value="selectedRepo" TItem="Repo" TValue="Repo" ValueChanged="@( (Repo r) =>SelectedResultChanged(r) )" ValueExpression="@(() => selectedRepo)" EnableDropDown="true" placeholder="Search by name..."> <SelectedTemplate Context="Repo"> @Repo.Name </SelectedTemplate> <ResultTemplate Context="Repo"> @Repo.Name (Id: @Repo.Id) </ResultTemplate> </BlazoredTypeahead>
private IList<Repo>? SelectedRepositories; private async Task SelectedResultChanged(Repo repo) { selectedRepo = repo; Console.WriteLine(repo.Name); }
You can't use bind-Value and ValueChanged. If you remove bind-Value and provide a value for the Value parameter then it will work.
bind-Value
Value
Hi,
In multi-select mode, I'm unable to hit the
ValueChanged
event, if I remove@bind-Values
the event triggers, but multi-select is removed, I don't know what am I doing wrong,?Help appreciated, Thanks.