From 38e3fac70e790303856aeda270c7044defe910b7 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Tue, 13 Feb 2024 11:05:05 +0100 Subject: [PATCH] RED-8183: close the box upon pressing esc. --- .../user-management/user-management.component.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/red-ui/src/app/modules/file-preview/components/user-management/user-management.component.ts b/apps/red-ui/src/app/modules/file-preview/components/user-management/user-management.component.ts index 28c1a1cbf..ef375270b 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/user-management/user-management.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/user-management/user-management.component.ts @@ -101,6 +101,13 @@ export class UserManagementComponent implements OnInit, OnDestroy { } } + @HostListener('document:keyup', ['$event']) + handleEsc($event: KeyboardEvent) { + if ($event.key === 'Escape' && this.editingReviewer) { + this.editingReviewer = false; + } + } + #customSort(ids: string[]) { let sorted = [...ids].sort((a, b) => this.userService.getName(a).localeCompare(this.userService.getName(b))); sorted = moveElementInArray(sorted, this._currentUserId, 0);