Skip to content

Commit

Permalink
Fixes error when pressing backspace in multiselect mode (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissainty authored Oct 31, 2020
1 parent 93d9145 commit fe3c4a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Blazored.Typeahead/BlazoredTypeahead.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,10 @@ private async Task HandleKeyup(KeyboardEventArgs args)
{
await SelectResult(Suggestions[SelectedIndex]);
}
else if (IsMultiselect && args.Key == "Backspace")
{
await RemoveValue(Values.Last());
else if (IsMultiselect && !IsShowingSuggestions && args.Key == "Backspace")
{
if (Values.Any())
await RemoveValue(Values.Last());
}
}

Expand Down

0 comments on commit fe3c4a2

Please sign in to comment.