diff --git a/src-ui/src/app/components/document-comments/document-comments.component.html b/src-ui/src/app/components/document-comments/document-comments.component.html index ffc8bfb9f..b30352414 100644 --- a/src-ui/src/app/components/document-comments/document-comments.component.html +++ b/src-ui/src/app/components/document-comments/document-comments.component.html @@ -1,7 +1,7 @@ <div *ngIf="comments"> <form [formGroup]="commentForm" class="needs-validation mt-3" *appIfPermissions="{ action: PermissionAction.Add, type: PermissionType.Comment }" novalidate> <div class="form-group"> - <textarea class="form-control form-control-sm" [class.is-invalid]="newCommentError" rows="3" formControlName="newComment" placeholder="Enter comment" i18n-placeholder required></textarea> + <textarea class="form-control form-control-sm" [class.is-invalid]="newCommentError" rows="3" formControlName="newComment" placeholder="Enter comment" i18n-placeholder (keydown)="commentFormKeydown($event)" required></textarea> <div class="invalid-feedback" i18n> Please enter a comment. </div> diff --git a/src-ui/src/app/components/document-comments/document-comments.component.ts b/src-ui/src/app/components/document-comments/document-comments.component.ts index 602d6bdb1..316a2ff28 100644 --- a/src-ui/src/app/components/document-comments/document-comments.component.ts +++ b/src-ui/src/app/components/document-comments/document-comments.component.ts @@ -106,4 +106,10 @@ export class DocumentCommentsComponent extends ComponentWithPermissions { } return nameComponents.join(' ') } + + commentFormKeydown(event: KeyboardEvent) { + if ((event.metaKey || event.ctrlKey) && event.key === 'Enter') { + this.addComment() + } + } }