From 2e171322218f2a3e992963d6adbda0af9d200a33 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Tue, 2 Jul 2024 16:08:10 +0200 Subject: [PATCH] fix: add space after mentioned user's name --- .../autocomplete-textarea.component.spec.ts | 2 +- .../autocomplete-textarea.component.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.spec.ts b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.spec.ts index 617ef672..833f7abe 100644 --- a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.spec.ts +++ b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.spec.ts @@ -240,7 +240,7 @@ describe('AutocompleteTextareaComponent', () => { }, '@' ) - ).toBe('@Jack'); + ).toBe('@Jack '); }); it('should update mentioned users if sent is triggered', () => { 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 aa661b0c..7c0748f4 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 @@ -238,11 +238,7 @@ export class AutocompleteTextareaComponent this.mentionedUsers.push((item.user ? item.user : item) as UserResponse); this.userMentions.next([...this.mentionedUsers]); } - return ( - triggerChar + - item.autocompleteLabel + - (triggerChar === this.commandTriggerChar ? ' ' : '') - ); + return triggerChar + item.autocompleteLabel + ' '; } autcompleteSearchTermChanged(searchTerm: string) {