File tree Expand file tree Collapse file tree
CodeBeam.MudBlazor.Extensions/Components/ComboBox Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments