@@ -94,9 +94,6 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
9494
9595 private _updateInput = true ;
9696
97- // stores the last filtered value - move to common?
98- private _internalFilter = '' ;
99-
10097 private _collapsing = false ;
10198
10299 /** @hidden @internal */
@@ -185,9 +182,9 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
185182 const oldSelection = this . selection ;
186183 this . selectionService . select_items ( this . id , this . isValid ( value ) ? [ value ] : [ ] , true ) ;
187184 this . cdr . markForCheck ( ) ;
188- this . _displayValue = this . createDisplayText ( this . selection , oldSelection ) ;
189- this . _value = this . valueKey ? this . selection . map ( item => item [ this . valueKey ] ) : this . selection ;
190- this . filterValue = this . _internalFilter = this . _displayValue ?. toString ( ) ;
185+ this . _displayValue = this . createDisplayText ( super . selection , oldSelection ) ;
186+ this . _value = this . valueKey ? super . selection . map ( item => item [ this . valueKey ] ) : super . selection ;
187+ this . filterValue = this . _displayValue ?. toString ( ) || '' ;
191188 }
192189
193190 /** @hidden @internal */
@@ -225,7 +222,6 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
225222 if ( this . composing ) {
226223 this . comboInput . focus ( ) ;
227224 }
228- this . _internalFilter = this . comboInput . value ;
229225 } ) ;
230226 this . dropdown . closing . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( args ) => {
231227 if ( args . cancel ) {
@@ -239,9 +235,6 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
239235 }
240236 this . comboInput . focus ( ) ;
241237 } ) ;
242- this . dropdown . closed . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
243- this . filterValue = this . _internalFilter = this . comboInput . value ;
244- } ) ;
245238
246239 // in reactive form the control is not present initially
247240 // and sets the selection to an invalid value in writeValue method
@@ -265,7 +258,7 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
265258 /** @hidden @internal */
266259 public override handleInputChange ( event ?: any ) : void {
267260 if ( event !== undefined ) {
268- this . filterValue = this . _internalFilter = this . searchValue = typeof event === 'string' ? event : event . target . value ;
261+ this . filterValue = this . searchValue = typeof event === 'string' ? event : event . target . value ;
269262 }
270263 this . _onChangeCallback ( this . searchValue ) ;
271264 if ( this . collapsed && this . comboInput . focused ) {
@@ -309,7 +302,6 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
309302 this . close ( ) ;
310303 // manually trigger text selection as it will not be triggered during editing
311304 this . textSelection . trigger ( ) ;
312- this . filterValue = this . getElementVal ( filtered ) ;
313305 return ;
314306 }
315307 if ( event . key === this . platformUtil . KEYMAP . BACKSPACE
@@ -364,11 +356,6 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
364356 super . onBlur ( ) ;
365357 }
366358
367- /** @hidden @internal */
368- public onFocus ( ) : void {
369- this . _internalFilter = this . comboInput . value || '' ;
370- }
371-
372359 /** @hidden @internal */
373360 public getEditElement ( ) : HTMLElement {
374361 return this . comboInput . nativeElement ;
@@ -465,7 +452,7 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
465452 this . selectionService . select_items ( this . id , argsSelection , true ) ;
466453 this . _value = argsSelection ;
467454 if ( this . _updateInput ) {
468- this . comboInput . value = this . _internalFilter = this . _displayValue = this . searchValue = displayText !== args . displayText
455+ this . comboInput . value = this . _displayValue = this . searchValue = displayText !== args . displayText
469456 ? args . displayText
470457 : this . createDisplayText ( this . selection , [ args . oldSelection ] ) ;
471458 }
@@ -545,7 +532,7 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
545532
546533 private clear ( ) : void {
547534 this . clearSelection ( true ) ;
548- this . comboInput . value = this . _internalFilter = this . _displayValue = this . searchValue = '' ;
535+ this . comboInput . value = this . _displayValue = this . searchValue = '' ;
549536 }
550537
551538 private isValid ( value : any ) : boolean {
0 commit comments