From faf6d21a295e0d5617c80f0a987bd8403b9953a0 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Thu, 5 Sep 2024 11:06:21 +0200 Subject: [PATCH] fix: don't send message on enter if isComposing is true --- .github/workflows/workflow.yml | 2 ++ package.json | 6 ++++++ .../autocomplete-textarea.component.ts | 2 +- .../src/lib/message-input/textarea/textarea.component.ts | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index fa83baf2..2ed1233d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -5,11 +5,13 @@ on: - master - beta - 4.x.x + - 4.x.x-beta pull_request: branches: - master - beta - 4.x.x + - 4.x.x-beta jobs: workflow: runs-on: ubuntu-latest diff --git a/package.json b/package.json index ec30c30d..6031a62c 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,12 @@ "branches": [ "master", "4.x.x", + { + "name": "4.x.x-beta", + "prerelease": true, + "channel": "beta", + "range": "4.x.x" + }, { "name": "beta", "prerelease": true 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 62c7df91..650773ab 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 @@ -254,7 +254,7 @@ export class AutocompleteTextareaComponent } enterHit(event: Event) { - if (this.inputMode === 'desktop') { + if (this.inputMode === 'desktop' && !(event as KeyboardEvent).isComposing) { event.preventDefault(); this.updateMentionedUsersFromText(); this.send.next(); diff --git a/projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts b/projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts index 30e15803..ce7e8fdf 100644 --- a/projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts @@ -96,7 +96,7 @@ export class TextareaComponent } enterHit(event: Event) { - if (this.inputMode === 'desktop') { + if (this.inputMode === 'desktop' && !(event as KeyboardEvent).isComposing) { event.preventDefault(); this.send.next(); }