File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
projects/cps-ui-kit/src/lib/components/cps-autocomplete Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -651,9 +651,8 @@ export class CpsAutocompleteComponent
651651
652652 onBlur ( ) {
653653 if ( ! this . isOpened ) {
654- this . _closeAndClear ( ) ;
654+ this . _confirmInput ( this . inputText || '' , false ) ;
655655 }
656-
657656 this . _checkErrors ( ) ;
658657 this . blurred . emit ( ) ;
659658 }
@@ -971,7 +970,10 @@ export class CpsAutocompleteComponent
971970 searchVal = searchVal . toLowerCase ( ) ;
972971 if ( ! searchVal ) {
973972 if ( this . multiple ) return ;
974- this . updateValue ( this . _getEmptyValue ( ) ) ;
973+ // Only reset the value if the inputText was changed by the user
974+ if ( this . inputText !== this . _getValueLabel ( ) ) {
975+ this . updateValue ( this . _getEmptyValue ( ) ) ;
976+ }
975977 this . cdRef . detectChanges ( ) ;
976978 this . _closeAndClear ( ) ;
977979 return ;
You can’t perform that action at this time.
0 commit comments