From ebc31229f7be6154f40168aa44989347dd8e142b Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Mon, 2 Dec 2024 15:33:54 +0100 Subject: [PATCH] fix: user mentions can have spaces --- .../autocomplete-textarea/autocomplete-textarea.component.ts | 2 ++ 1 file changed, 2 insertions(+) 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 233cc976..c71e953d 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 @@ -100,6 +100,7 @@ export class AutocompleteTextareaComponent private userMentionConfig: Mentions = { triggerChar: this.mentionTriggerChar, dropUp: true, + allowSpace: true, labelKey: this.autocompleteKey, returnTrigger: true, mentionFilter: ( @@ -252,6 +253,7 @@ export class AutocompleteTextareaComponent this.mentionedUsers.push((item.user ? item.user : item) as UserResponse); this.userMentions.next([...this.mentionedUsers]); } + this.searchTerm$.next(''); return triggerChar + item.autocompleteLabel + ' '; }