From 9aa41b35242e8e7ecdfa3a01eaa66d01caee885d Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 16 Mar 2023 22:56:33 -0700 Subject: [PATCH] Support control/command-enter submit comment form --- .../document-comments/document-comments.component.html | 2 +- .../document-comments/document-comments.component.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 @@
- +
Please enter a comment.
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() + } + } }