From b399359fd0f40e69b38f759d2aca4f4243afce0d Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Mon, 8 Jan 2024 13:59:37 +0100 Subject: [PATCH] fix: Deleting and reentering the same char after @ doesn't update the mention menu --- .../autocomplete-textarea.component.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts index 6b636b29..0c06a3fe 100644 --- a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts @@ -128,13 +128,12 @@ export class AutocompleteTextareaComponent private customTemplatesService: CustomTemplatesService, private themeService: ThemeService ) { - this.searchTerm$ - .pipe(debounceTime(300), distinctUntilChanged()) - .subscribe((searchTerm) => { - if (searchTerm.startsWith(this.mentionTriggerChar)) { - void this.updateMentionOptions(searchTerm); - } - }); + this.searchTerm$.pipe(debounceTime(300)).subscribe((searchTerm) => { + console.log(searchTerm); + if (searchTerm.startsWith(this.mentionTriggerChar)) { + void this.updateMentionOptions(searchTerm); + } + }); this.subscriptions.push( this.channelService.activeChannel$.subscribe((channel) => { const commands = channel?.getConfig()?.commands || [];