mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Support control/command-enter submit comment form
This commit is contained in:
		| @@ -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> | ||||
|   | ||||
| @@ -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() | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 shamoon
					shamoon