Skip to content

Commit cde2807

Browse files
authored
ComboBox: Bugfix #208 (#314)
* Fixes #208 * Rename prop
1 parent bfb2627 commit cde2807

1 file changed

Lines changed: 7 additions & 19 deletions

File tree

CodeBeam.MudBlazor.Extensions/Components/ComboBox/MudComboBox.razor.cs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -896,28 +896,16 @@ protected internal async void HandleKeyUp(KeyboardEventArgs obj)
896896

897897
protected internal async Task HandleOnBlur(FocusEventArgs obj)
898898
{
899-
900-
if (Strict == false)
899+
if (Strict)
901900
{
902-
await UpdateComboBoxValueAsync(Converter.Get(_searchString), updateText: true, updateSearchString: true);
901+
var item = Items.FirstOrDefault(x => Converter.Set(x.Value).Equals(_searchString, StringComparison.OrdinalIgnoreCase));
902+
if (item is not null)
903+
await ToggleOption(item, true);
904+
else
905+
await Clear();
903906
}
904907
else
905-
{
906-
if (Items.Select(x => x.Value).Contains(Converter.Get(_searchString)) == false)
907-
{
908-
if (Items.Select(x => x.Value).Contains(Value))
909-
{
910-
await ToggleOption(Items.FirstOrDefault(x => x.Value.Equals(Value)), true);
911-
}
912-
else
913-
{
914-
await Clear();
915-
}
916-
917-
//_searchString = Text;
918-
}
919-
}
920-
908+
await UpdateComboBoxValueAsync(Converter.Get(_searchString), updateText: true, updateSearchString: true);
921909

922910
await OnBlurredAsync(obj);
923911
}

0 commit comments

Comments
 (0)