From 5b41632e1fb11dd27642f52d99ce6e443355910e Mon Sep 17 00:00:00 2001 From: cmoinier Date: Mon, 25 Nov 2024 18:16:00 +0100 Subject: [PATCH] fix: avoid keyword being the selection --- .../src/lib/autocomplete/autocomplete.component.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts b/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts index f493430a8..0b7703c5c 100644 --- a/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +++ b/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts @@ -130,17 +130,11 @@ export class AutocompleteComponent ) ) - const externalValueChange$ = this.control.valueChanges.pipe( - filter((value) => typeof value === 'object' && value.title), - map((item) => item.title) - ) - // this observable emits arrays of suggestions loaded using the given action const suggestionsFromAction = merge( newValue$.pipe( filter((value: string) => value.length >= this.minCharacterCount) - ), - externalValueChange$ + ) ).pipe( tap(() => { this.searching = true @@ -242,6 +236,7 @@ export class AutocompleteComponent } if (this.clearOnSelection) { this.inputRef.nativeElement.value = '' + this.inputCleared.emit() } } }