diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts index ca962e762..436f34efb 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts @@ -316,9 +316,6 @@ export class FilePreviewScreenComponent @Bind() handleEscInsideViewer($event: KeyboardEvent) { $event.preventDefault(); - if (this._multiSelectService.active()) { - this._multiSelectService.deactivate(); - } if (!!this._annotationManager.selected[0]) { const doesHaveWrapper = this._fileDataService.find(this._annotationManager.selected[0]?.Id); if (!doesHaveWrapper) { @@ -327,6 +324,14 @@ export class FilePreviewScreenComponent this._annotationManager.deselect(this._annotationManager.selected[0]?.Id); } } + + if (this._annotationManager.selected.length) { + this._annotationManager.deselectAll(); + } + + if (this._multiSelectService.active()) { + this._multiSelectService.deactivate(); + } } async ngOnAttach(previousRoute: ActivatedRouteSnapshot) { @@ -425,9 +430,15 @@ export class FilePreviewScreenComponent .find(annotation => annotation.id === this._annotationManager.resizingAnnotationId); this._annotationActionsService.cancelResize(resizedAnnotation).then(); } + + if (this._annotationManager.selected.length) { + this._annotationManager.deselectAll(); + } + if (this._multiSelectService.active()) { this._multiSelectService.deactivate(); } + this.fullScreen = false; this.closeFullScreen(); this._changeRef.markForCheck(); diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts index 8472bdd93..e86b97e7c 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts @@ -98,6 +98,10 @@ export class REDAnnotationManager { this.#manager.deselectAnnotations(ann); } + deselectAll() { + this.deselect(this.selected.map(annotation => annotation.Id)); + } + hide(annotations: Annotation[]): void { this.#manager.hideAnnotations(annotations); } diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts index 09fc4f9a7..a20d160d5 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts @@ -274,6 +274,7 @@ export class PdfViewer { this.#instance.UI.hotkeys.on('esc', { keydown: e => { e.preventDefault(); + this.#clickSelectToolButton(); }, keyup: e => { e.preventDefault();